API Overview
API Base URL
https://codexapi.asiaEvery public model endpoint requires an API key. The recommended header is:
http
Authorization: Bearer YOUR_API_KEYInteractive 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
| Method | Path | Purpose |
|---|---|---|
GET | /v1/models | List models available to the current key |
GET | /v1/usage | Get gateway usage information |
POST | /v1/responses | OpenAI Responses |
GET | /v1/responses | Responses WebSocket upgrade endpoint |
POST | /v1/chat/completions | OpenAI Chat Completions |
POST | /v1/embeddings | OpenAI Embeddings |
POST | /v1/images/generations | Generate images |
POST | /v1/images/edits | Edit 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.
