LLMsRelay/Docs
Back to dashboard

OpenAI & Codex Endpoints — API Reference

API reference for the OpenAI API through LLMsRelay Codex: OpenAI models over Chat Completions and Responses APIs, streaming, model discovery, and billing.

Base URL: https://api.llmsrelay.com/v1. Chat: POST /v1/chat/completions. Responses: POST /v1/responses. Models: GET /v1/models. Auth: Bearer sk-cs4-* (Codex group).

Authentication

All requests use an sk-cs4-… key whose group is set to Codex in the dashboard. Use Basic or Pro keys for Claude models; the account balance is shared:

headerbash
Authorization: Bearer sk-cs4-your-key

Endpoints

Method & PathFormatUsed by
POST /v1/chat/completionsOpenAI Chat CompletionsCline, Roo, Continue, OpenAI SDK
POST /v1/responsesOpenAI ResponsesCodex CLI, Codex extension
GET /v1/modelsOpenAI ModelsModel discovery
/v1/messages (Anthropic Messages format) is not served for Codex-group keys — it returns a hint to use the OpenAI endpoints above.

Models

Current OpenAI models:

  • gpt-5.5
  • gpt-5.4

Query the live catalogue at any time:

GET /v1/modelsbash
curl https://api.llmsrelay.com/v1/models \
  -H "Authorization: Bearer sk-cs4-your-key"

Chat Completions

Request

POST /v1/chat/completionsbash
curl https://api.llmsrelay.com/v1/chat/completions \
  -H "Authorization: Bearer sk-cs4-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      {"role": "system", "content": "You are concise."},
      {"role": "user", "content": "Explain TCP in one sentence."}
    ],
    "stream": false
  }'

Standard OpenAI fields are supported: stream, temperature, top_p, tools / function calling, and stream_options.include_usage.

Responses API

The Responses API is what Codex CLI and the Codex extension use. Minimal request:

POST /v1/responsesbash
curl https://api.llmsrelay.com/v1/responses \
  -H "Authorization: Bearer sk-cs4-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "input": "Refactor this function for readability."
  }'
For end-to-end Codex CLI / extension configuration, see the Codex CLI & Extension guide.

Streaming

Both endpoints support Server-Sent Events. Set "stream": true on chat completions, or use the Responses API streaming events. Add stream_options.include_usage = true to receive a final usage chunk.

Billing

OpenAI requests are deducted from your LLMsRelay credit balance at the published OpenAI token rates. Each response includes the standard OpenAI usage object (prompt, completion, and total tokens). See How Billing Works for the credit model.

Ready to start?

Create a key and configure a compatible API route in under 2 minutes.

View Plans