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:
Authorization: Bearer sk-cs4-your-keyEndpoints
| Method & Path | Format | Used by |
|---|---|---|
POST /v1/chat/completions | OpenAI Chat Completions | Cline, Roo, Continue, OpenAI SDK |
POST /v1/responses | OpenAI Responses | Codex CLI, Codex extension |
GET /v1/models | OpenAI Models | Model 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.5gpt-5.4
Query the live catalogue at any time:
curl https://api.llmsrelay.com/v1/models \
-H "Authorization: Bearer sk-cs4-your-key"Chat Completions
Request
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:
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."
}'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.