# OpenAI-compatible API (/en/docs/api/compatible/openai)



## Base URL [#base-url]

<ApiBaseDomain prefix="/openai/v1" />

## Get started [#get-started]

<QuickstartTabs snippets="{&#x22;curl&#x22;:&#x22;curl https://api-origin.invalid/openai/v1/chat/completions \\\n  -H \&#x22;Authorization: Bearer $PRAXIS_API_KEY\&#x22; \\\n  -H \&#x22;Content-Type: application/json\&#x22; \\\n  -d '{\&#x22;model\&#x22;:\&#x22;deepseek-v4-flash\&#x22;,\&#x22;messages\&#x22;:[{\&#x22;role\&#x22;:\&#x22;user\&#x22;,\&#x22;content\&#x22;:\&#x22;你好\&#x22;}]}'&#x22;,&#x22;python&#x22;:&#x22;import os\n\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\&#x22;https://api-origin.invalid/openai/v1\&#x22;,\n    api_key=os.environ[\&#x22;PRAXIS_API_KEY\&#x22;],\n)\n\nresp = client.chat.completions.create(\n    model=\&#x22;deepseek-v4-flash\&#x22;,\n    messages=[{\&#x22;role\&#x22;: \&#x22;user\&#x22;, \&#x22;content\&#x22;: \&#x22;你好\&#x22;}],\n)&#x22;,&#x22;typescript&#x22;:&#x22;import OpenAI from \&#x22;openai\&#x22;;\n\nconst client = new OpenAI({\n  baseURL: \&#x22;https://api-origin.invalid/openai/v1\&#x22;,\n  apiKey: process.env.PRAXIS_API_KEY,\n});\n\nconst resp = await client.chat.completions.create({\n  model: \&#x22;deepseek-v4-flash\&#x22;,\n  messages: [{ role: \&#x22;user\&#x22;, content: \&#x22;你好\&#x22; }],\n});&#x22;}" />

## Endpoints [#endpoints]

| Method | Path                                                                                                          | Description                  | Support       |
| ------ | ------------------------------------------------------------------------------------------------------------- | ---------------------------- | ------------- |
| POST   | [`/v1/chat/completions`](/docs/api/compatible/openai/createChatCompletion)                                    | Create chat completion       | ● Supported   |
| POST   | [`/v1/responses`](/docs/api/compatible/openai/createResponse)                                                 | Create a response            | ● Supported   |
| GET    | [`/v1/responses/{response_id}`](/docs/api/compatible/openai/retrieveResponse)                                 | Retrieve a response          | ● Supported   |
| DELETE | [`/v1/responses/{response_id}`](/docs/api/compatible/openai/deleteResponse)                                   | Delete a response            | ● Supported   |
| POST   | [`/v1/responses/{response_id}/cancel`](/docs/api/compatible/openai/cancelResponse)                            | Cancel a response            | ◐ Partial     |
| GET    | [`/v1/responses/{response_id}/input_items`](/docs/api/compatible/openai/listResponseInputItems)               | List input items             | ● Supported   |
| POST   | [`/v1/responses/compact`](/docs/api/compatible/openai/compactResponse)                                        | Compact a response           | ○ Unsupported |
| POST   | [`/v1/responses/input_tokens`](/docs/api/compatible/openai/countResponseInputTokens)                          | Count input tokens           | ○ Unsupported |
| POST   | [`/v1/conversations`](/docs/api/compatible/openai/createConversation)                                         | Create a conversation        | ● Supported   |
| GET    | [`/v1/conversations/{conversation_id}`](/docs/api/compatible/openai/retrieveConversation)                     | Retrieve a conversation      | ● Supported   |
| POST   | [`/v1/conversations/{conversation_id}`](/docs/api/compatible/openai/updateConversation)                       | Update a conversation        | ● Supported   |
| DELETE | [`/v1/conversations/{conversation_id}`](/docs/api/compatible/openai/deleteConversation)                       | Delete a conversation        | ● Supported   |
| POST   | [`/v1/conversations/{conversation_id}/items`](/docs/api/compatible/openai/createConversationItems)            | Create conversation items    | ● Supported   |
| GET    | [`/v1/conversations/{conversation_id}/items`](/docs/api/compatible/openai/listConversationItems)              | List conversation items      | ● Supported   |
| GET    | [`/v1/conversations/{conversation_id}/items/{item_id}`](/docs/api/compatible/openai/retrieveConversationItem) | Retrieve a conversation item | ● Supported   |
| DELETE | [`/v1/conversations/{conversation_id}/items/{item_id}`](/docs/api/compatible/openai/deleteConversationItem)   | Delete a conversation item   | ● Supported   |
| POST   | [`/v1/images/generations`](/docs/api/compatible/openai/createImage)                                           | Create an image              | ● Supported   |
| GET    | [`/v1/models`](/docs/api/compatible/openai/listModels)                                                        | List models                  | ● Supported   |
| GET    | [`/v1/models/{model}`](/docs/api/compatible/openai/retrieveModel)                                             | Retrieve model               | ● Supported   |
| POST   | [`/v1/embeddings`](/docs/api/compatible/openai/createEmbedding)                                               | Create embeddings            | ● Supported   |
| POST   | [`/v1/videos`](/docs/api/compatible/openai/createVideo)                                                       | Create video                 | ● Supported   |
| GET    | [`/v1/videos`](/docs/api/compatible/openai/listVideos)                                                        | List videos                  | ● Supported   |
| GET    | [`/v1/videos/{video_id}`](/docs/api/compatible/openai/retrieveVideo)                                          | Retrieve video               | ● Supported   |
| GET    | [`/v1/videos/{video_id}/content`](/docs/api/compatible/openai/downloadVideoContent)                           | Download video content       | ● Supported   |
| DELETE | [`/v1/videos/{video_id}`](/docs/api/compatible/openai/deleteVideo)                                            | Delete video                 | ● Supported   |
| POST   | [`/v1/videos/{video_id}/remix`](/docs/api/compatible/openai/remixVideo)                                       | Remix video                  | ○ Unsupported |
| POST   | [`/v1/audio/transcriptions`](/docs/api/compatible/openai/openaiAudioTranscriptionsCreate)                     | Transcribe audio             | ● Supported   |
| POST   | [`/v1/files`](/docs/api/compatible/openai/createFile)                                                         | Upload a file                | ◐ Partial     |
| GET    | [`/v1/files`](/docs/api/compatible/openai/listFiles)                                                          | List files                   | ● Supported   |
| GET    | [`/v1/files/{file_id}`](/docs/api/compatible/openai/retrieveFile)                                             | Retrieve file                | ● Supported   |
| DELETE | [`/v1/files/{file_id}`](/docs/api/compatible/openai/deleteFile)                                               | Delete file                  | ● Supported   |
| GET    | [`/v1/files/{file_id}/content`](/docs/api/compatible/openai/retrieveFileContent)                              | Retrieve file content        | ● Supported   |
| POST   | `/v1/audio/speech`                                                                                            | Generate speech              | ● Supported   |
| POST   | `/v1/images/edits`                                                                                            | Edit images                  | ● Supported   |

[Vector stores (16 operations)](/en/docs/api/compatible/openai/vector-stores): create stores, attach files, manage batches and search.

## Unsupported endpoints [#unsupported-endpoints]

These endpoints are unavailable under /openai/v1 and return 404. The alternatives are workflows, not equivalent endpoints.

| Endpoint                 | Alternative                                                                |
| ------------------------ | -------------------------------------------------------------------------- |
| `/v1/moderations`        | No alternative endpoint                                                    |
| `/v1/batches`            | Call the required model endpoint individually                              |
| `/v1/fine_tuning`        | Use an existing model from the catalog                                     |
| `/v1/assistants`         | Build sessions with Responses and Conversations                            |
| `/v1/completions`        | Use chat/completions                                                       |
| `/v1/audio/translations` | Transcribe with audio/transcriptions, then translate with chat/completions |
| `/v1/uploads`            | Upload files with files                                                    |
| `/v1/images/variations`  | Submit an image and editing prompt with images/edits                       |

## Differences from OpenAI [#differences-from-openai]

* <a href="/docs/api/compatible/openai/createChatCompletion">Create chat completion</a>：Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.
* <a href="/docs/api/compatible/openai/createResponse">Create a response</a>：Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.
* <a href="/docs/api/compatible/openai/retrieveResponse">Retrieve a response</a>：Reads a stored response by ID. If it was created with store set to false we did not store it, and the read returns 404 response\_not\_found; after the retention period (30 days by default) the read returns the same 404.
* <a href="/docs/api/compatible/openai/deleteResponse">Delete a response</a>：Deletes a stored response by ID immediately. If it was created with store set to false we did not store it, and the delete returns 404 response\_not\_found.
* <a href="/docs/api/compatible/openai/cancelResponse">Cancel a response</a>：Available only for responses created with background:true and routed to a model that can generate in the background. Cancel is idempotent — repeated calls return the same terminal response. Cancelling stops us reading the upstream stream; it cannot guarantee that compute already sent upstream stops, and usage is billed for what was actually received. Calling cancel on a non-background (synchronous) response returns 404 object\_not\_found if the response id does not exist (not stored, expired or wrong id), or 400 native\_responses\_operation\_unsupported if the response exists but its provider does not declare cancel support (none of the upstreams we connect declares it for synchronous responses). Neither case is the not-implemented 501.
* <a href="/docs/api/compatible/openai/listResponseInputItems">List input items</a>：Lists the input items of a stored response. Supports limit (1–100, default 20), order (asc/desc, default desc, as in the official API) and cursor pagination by item id with after; has\_more / first\_id / last\_id match the page actually returned, so you can page through without gaps or repeats. Every item carries a server-issued id (msg\_ for messages, and each of function\_call / function\_call\_output / reasoning has its own prefix); older data stored before ids existed gets deterministic ids on read, without a destructive migration, so repeated reads with the same cursor stay stable. For a response created with previous\_response\_id, the list shows the full resolved input: the input and output items of the earlier responses in the chain plus the input submitted this turn; if an ancestor response was not stored on the platform (for example created with store false) or has expired, only this turn's own input is listed. If the response was created with store set to false we did not store it, and the list returns 404 response\_not\_found.
* <a href="/docs/api/compatible/openai/compactResponse">Compact a response</a>：Compacts a response's input into a summary. It depends on OpenAI Responses' official server-side storage (store) semantics, which we have not implemented yet; calling it returns 501 (message “This platform has not implemented … yet.”, with the x-should-retry header set to false), has no side effects, and the official SDK will not retry.
* <a href="/docs/api/compatible/openai/countResponseInputTokens">Count input tokens</a>：Counts the tokens the request input would consume without generating content. It depends on OpenAI Responses' official server-side storage (store) semantics, which we have not implemented yet; calling it returns 501 (message “This platform has not implemented … yet.”, with the x-should-retry header set to false), has no side effects, and the official SDK will not retry.
* <a href="/docs/api/compatible/openai/createConversation">Create a conversation</a>：Creates a conversation, optionally with initial items (up to 20 at a time) and metadata. Conversations are partitioned by tenant; only the creating tenant can reference it.
* <a href="/docs/api/compatible/openai/retrieveConversation">Retrieve a conversation</a>：Reads a conversation by ID. A conversation that does not exist or belongs to another tenant returns 404 conversation\_not\_found.
* <a href="/docs/api/compatible/openai/updateConversation">Update a conversation</a>：Updates a conversation's metadata — the whole object is replaced, not merged with the existing metadata.
* <a href="/docs/api/compatible/openai/deleteConversation">Delete a conversation</a>：Deletes a conversation. After deletion neither the conversation nor its items can be referenced again (including as the conversation parameter of Responses create).
* <a href="/docs/api/compatible/openai/createConversationItems">Create conversation items</a>：Appends items to a conversation (up to 20 at a time) and returns the items just added.
* <a href="/docs/api/compatible/openai/listConversationItems">List conversation items</a>：Lists a conversation's items in creation order, with limit / after / order pagination.
* <a href="/docs/api/compatible/openai/retrieveConversationItem">Retrieve a conversation item</a>：Reads a single item of a conversation by ID.
* <a href="/docs/api/compatible/openai/deleteConversationItem">Delete a conversation item</a>：Deletes a single item of a conversation and returns the conversation object (not the deleted item).
* <a href="/docs/api/compatible/openai/retrieveModel">Retrieve model</a>：Returns the same model object as its entry in the list. Only models that declare an OpenAI API are visible; model IDs may carry slash-separated publisher prefixes. A model that does not exist or declares no OpenAI API returns 404.
* <a href="/docs/api/compatible/openai/createEmbedding">Create embeddings</a>：Forwarded the same way as chat completions, and usage is billed on the same account. Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.
* <a href="/docs/api/compatible/openai/createVideo">Create video</a>：Generates video asynchronously: create a job, poll its status, then download the content. Billed per second of output; GET /model/v1/models exposes pricing.video\_second in USD per second. Select a registered video model explicitly, for example wan2.7-t2v.
* <a href="/docs/api/compatible/openai/listVideos">List videos</a>：Lists the video jobs of your account. limit is 1–100, order is asc or desc, and after must refer to an existing job.
* <a href="/docs/api/compatible/openai/retrieveVideo">Retrieve video</a>：Reads the job's current status and progress. Keep polling while status is queued or in\_progress, inspect error when it is failed, and download the content only once it is completed. An unknown job returns 404.
* <a href="/docs/api/compatible/openai/downloadVideoContent">Download video content</a>：Downloads the video file (video, MP4) or the thumbnail (thumbnail) once the job is completed; spritesheet returns 400 and index supports 0 only. An unknown job returns 404.
* <a href="/docs/api/compatible/openai/deleteVideo">Delete video</a>：Deletes the job and its generated content. An unknown job returns 404.
* <a href="/docs/api/compatible/openai/remixVideo">Remix video</a>：Unsupported; the call always returns 400 (invalid\_request\_error, message "Video remix is not supported"). Do not retry.
* <a href="/docs/api/compatible/openai/openaiAudioTranscriptionsCreate">Transcribe audio</a>：Standard request fields; unrepresentable parameters return input\_not\_representable.
* <a href="/docs/api/compatible/openai/createFile">Upload a file</a>：Upload one file, up to 100 MB (104857600 bytes), using streaming multipart/form-data. Supported content-detected types: PDF; DOCX, XLSX, PPTX; PNG, JPEG, GIF, WebP; MP3, WAV, FLAC, OGG, M4A; MP4, WebM; UTF-8 JSON, NDJSON, CSV, Markdown and plain text. Purposes: user\_data, assistants, vision. Other purposes and empty/unsupported/oversized files return 400. OpenAI Uploads chunking is not supported. expires\_after accepts anchor created\_at and seconds 3600–2592000. Only form file, purpose, expires\_after\[anchor] and expires\_after\[seconds] are accepted; any other form field or any query parameter returns 400 invalid\_request\_error "Unrecognized request argument supplied: \<name>" with param naming it.
* <a href="/docs/api/compatible/openai/listFiles">List files</a>：Only the after, order, limit and purpose query parameters are accepted; any other returns 400 invalid\_request\_error "Unrecognized request argument supplied: \<name>" with param naming it.

For authoritative parameter definitions, see the [official OpenAI documentation](https://platform.openai.com/docs/api-reference).

Errors follow the OpenAI format, see [errors](/docs/api/errors); quotas and response headers are covered in [rate limits](/docs/api/rate-limits).
