Skip to content

API Overview ​

API Base URLhttps://codexapi.asia

Every public model endpoint requires an API key. The recommended header is:

http
Authorization: Bearer YOUR_API_KEY

Interactive testing

Open the Interactive API Explorer to inspect schemas, switch endpoints, and generate request snippets in several languages. Enter only your own API key; the explorer does not write authentication values into the documentation content.

Endpoints ​

MethodPathPurpose
GET/v1/modelsList models available to the current key
GET/v1/usageGet gateway usage information
POST/v1/responsesOpenAI Responses
GET/v1/responsesResponses WebSocket upgrade endpoint
POST/v1/chat/completionsOpenAI Chat Completions
POST/v1/embeddingsOpenAI Embeddings
POST/v1/images/generationsGenerate images
POST/v1/images/editsEdit images

OpenAI API ​

Responses ​

bash
curl https://codexapi.asia/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "input": "Reply with OK.",
    "stream": false
  }'

Chat Completions ​

bash
curl https://codexapi.asia/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "messages": [{"role": "user", "content": "Reply with OK."}]
  }'

Embeddings ​

bash
curl https://codexapi.asia/v1/embeddings \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "input": "Text to embed"
  }'

Request IDs ​

Keep the request ID from the response body or correlation headers when troubleshooting. Share the request ID, timestamp, and model, but never the full API key.