Skip to content

OpenAI API Quickstart ​

CODEX RELAY / OPENAI GATEWAY

Use one API key for OpenAI Responses, Chat Completions, Embeddings, and Images. Follow this guide to list your models and send a first request in a few minutes.

OpenAI CompatibleResponses FirstDEV-0807
API Base URLhttps://codexapi.asia

1. Create an API key ​

Sign in to the console

Open the Codex Relay console. Create an account first if registration is currently available.

Open the API Keys page

Create a key, select a group that publishes the OpenAI models you need, and give it a recognizable name.

Store it immediately

Treat the key like a password. Do not place it in chat history, screenshots, browser code, or public repositories.

2. List available models ​

Replace YOUR_API_KEY with the key you created:

bash
curl https://codexapi.asia/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"

The key's assigned group determines the model list. A client model name must exactly match an id returned by this request.

3. Send your first request ​

This example uses the OpenAI-compatible Chat Completions endpoint. Replace MODEL_ID with a model from the previous response:

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": "Say hello in one sentence."}
    ],
    "stream": false
  }'

Which Base URL should I use?

  • For an API Host/Base URL field, start with https://codexapi.asia.
  • For the OpenAI SDK base_url, use https://codexapi.asia/v1.
  • Make sure the final request path does not contain /v1/v1/....

Next steps ​