GET/v1/files/{file_id}/content

Download a file

The raw file as application/jsonl. For a batch output file, each line is {"id", "custom_id", "response": {"status_code", "body"}, "error"}, where body is the provider-shaped response including its token usage. Lines carry no usage.cost; spend shows in your usage history.

Error-file lines have response: null and an error object.

Authentication: Bearer API key in the Authorization header

Path parameters

  • file_idstringrequired

    The file id.

Responses

  • 200

    The file bytes.

  • 401

    The key is missing, malformed, expired or revoked.

    Response
    • errorobject
      error
      • messagestring

        What went wrong and how to fix it.

      • typestring

        For example invalid_request_error, authentication_error, permission_error, rate_limit_error, insufficient_quota, api_error.

      • codestring

        The stable error code.

      • paramstring | null

        The request field at fault, when there is one.

      • refusal_reasonenum

        Present only on code: refusal.

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"
  • 404

    No such resource for this key.

    Response
    • errorobject
      error
      • messagestring

        What went wrong and how to fix it.

      • typestring

        For example invalid_request_error, authentication_error, permission_error, rate_limit_error, insufficient_quota, api_error.

      • codestring

        The stable error code.

      • paramstring | null

        The request field at fault, when there is one.

      • refusal_reasonenum

        Present only on code: refusal.

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"

Request

curl https://api.experientiallabs.ai/v1/files/file_7b1d9e3a5c2f4086b4a1e9c7/content \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --output results.jsonl

Response

{"id":"batch_9c2e4b7a1f0d3e6c5b8a2d4f_line_0","custom_id":"req-1","response":{"status_code":200,"body":{"id":"chatcmpl_a1b2","object":"chat.completion","model":"gpt-6-luna","choices":[{"index":0,"message":{"role":"assistant","content":"Hi! How can I help?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":8,"completion_tokens":7,"total_tokens":15}}},"error":null}

https://api.experientiallabs.ai/v1/files/file_3f9a1c0e7b2d4a6f8e1c2b3d/content