OpenAI API (Chat Completions + Responses)
- Kind: raw API; the de-facto OpenAI-compatible standard Cyberine's
LoopAgentAdaptertargets - Official docs: https://developers.openai.com/api/docs (platform.openai.com/docs 301-redirects here)
- Cyberine usage: reached via the LiteLLM gateway (
openai/gptalias) and is the API behind the Codex CLI. - Researched/verified: 2026-06-07 — confidence medium (gpt-5.x ids/pricing newer than the model's training cutoff; confirmed only via live fetch).
Base URL & auth
| Base URL | https://api.openai.com/v1 |
| Auth header | Authorization: Bearer <OPENAI_API_KEY> (+ optional OpenAI-Organization) |
| Keys | https://platform.openai.com/api-keys |
The openai Node SDK constructor accepts a custom baseURL — this is how Cyberine points the same client at LiteLLM/OpenRouter/DeepSeek without code changes.
Endpoints
| Method + path | Purpose |
|---|---|
POST /v1/chat/completions | Classic chat completions. The OpenAI-compatible interface Cyberine targets. |
POST /v1/responses | Newer agentic API (state via previous_response_id, built-in tools). Default for new projects. |
GET /v1/models, GET /v1/models/{id} | Model catalog/metadata. |
POST /v1/embeddings | Embeddings (text-embedding-3-large/small, ada-002). |
POST /v1/images/generations | Image gen (gpt-image-2). |
POST /v1/batch | Async batch (50% cheaper). |
Models (selected, Jun 2026)
| Model id | Notes |
|---|---|
gpt-5.5 | Flagship 2026; 1M ctx; $5/$30 (cached input $0.50). |
gpt-5.5-pro | $30/$180. |
gpt-5.4 | Affordable coding/pro; 1M ctx; $2.50/$15. |
gpt-5.4-mini | 400K ctx; $0.75/$4.50. |
gpt-5.4-nano | $0.20/$1.25. |
o3, o3-pro | Reasoning models. |
gpt-4.1, gpt-4.1-mini | 1M ctx; instruction + tool calling. |
gpt-4o (-2024-11-20) | 128K ctx, 16384 max out; -2024-08-06 deprecated. |
gpt-oss-120b / gpt-oss-20b | Open-weight. |
openai/gptin Cyberine config (LOOP_MODEL_B) is a placeholder, not a real id — override via the gateway.
Key request params
- Chat Completions:
model,messages,temperature,max_completion_tokens(use over deprecatedmax_tokens),stream+stream_options.include_usage,tools/tool_choice,response_format(json_object/json_schema),n,stop,top_p, penalties,logprobs,seed - Responses API:
input(replacesmessages),instructions(replaces system msg),max_output_tokens,previous_response_id,store,reasoning:{effort},truncation,include
Notable features
- Streaming SSE: chunks
{choices:[{delta:{content|tool_calls}, finish_reason}]}, terminated bydata: [DONE]; usage needsstream_options:{include_usage:true}. - Tool/function calling with
strict:trueschema adherence; arguments returned as JSON strings (mustJSON.parse). - Structured Outputs (
response_format:{type:'json_schema'}). - Responses API: agentic loop, built-in web/file search, computer use, code interpreter, remote MCP; better cache utilization.
- Prompt caching (e.g. gpt-5.5 cached input 90% off), reasoning models (
reasoning:{effort}), Batch API (50% off).
Gotchas
platform.openai.com/docs→developers.openai.com/api/docs(update hardcoded links).max_tokensis deprecated →max_completion_tokens(Chat) /max_output_tokens(Responses).n(multiple completions) not in Responses API.- Streaming usage requires explicit
stream_options:{include_usage:true}. - Tool arguments are JSON strings, not objects.
gpt-4o-2024-08-06deprecated → pingpt-4o-2024-11-20.- Assistants API sunsets 2026-08-26 → migrate to Responses;
v1/promptsshut down 2026-11-30. - Regional data-residency endpoints carry a 10% uplift for models released on/after 2026-03-05.
Pricing
Per 1M in/out (cached in), Standard tier, short context, verified live 2026-09-17: gpt-5.6-sol $4/$20 ($0.40); gpt-5.6-terra $2/$12 ($0.20); gpt-5.6-luna $0.20/$1.20 ($0.02); gpt-6-astra $10/$50 ($1.00). Table: https://developers.openai.com/api/docs/pricing
GPT-6 Sol and Luna (Codex rust-v0.156.1 model picker; kdhbf), verified live 2026-09-25 against the same table and the per-model pages /api/docs/models/gpt-6-sol, /gpt-6-luna, /gpt-6-astra: gpt-6-sol $2/$10 ($0.20), gpt-6-luna $0.10/$0.50 ($0.01), gpt-6-astra $10/$50 ($1.00); all three 1,050,000-token context, 128,000 max output, single snapshot each. All three are now in src/core/modelCatalog.ts and src/core/modelPricing.ts; no Cyberine default moved.
GPT-6.1 Sol, verified live 2026-10-02 against /api/docs/models/gpt-6.1-sol: $2/$10 ($0.10 cached, 5% of input where 6 Sol is 10%), 1,050,000-token context, 128,000 max output, single snapshot gpt-6.1-sol. Added to src/core/modelCatalog.ts, src/core/modelPricing.ts and the strength table (rank 5, model-strength.md).
Cyberine integration notes
Direct worker: loop-openai-build
loop-openai-build is a LoopAgentAdapter that calls https://api.openai.com/v1 directly (no gateway).
| Env var | Default | Purpose |
|---|---|---|
OPENAI_API_KEY | (required) | Enables the worker; absence skips it with a logged note. |
OPENAI_BASE_URL | https://api.openai.com/v1 | Override to point at a compatible endpoint. |
OPENAI_MODEL | gpt-5.6-terra | Model id passed to the adapter (default moved from gpt-4o in T643). |
The worker is activated by including loop-openai-build in CYBERINE_BUILD_FLEET. It uses the /v1/chat/completions endpoint (streaming + tools + stream_options.include_usage); the Responses API is not used by LoopAgentAdapter.
Gateway path: LOOP_MODEL_B
OpenAI models are also reachable through the LiteLLM gateway (litellm.md) via LOOP_MODEL_B (e.g. openai/gpt-4o). This is the gateway route, separate from the direct key path above.
CLI workers
The Codex CLI worker (codex-cli.md) also targets OpenAI models; it uses the CLI binary rather than LoopAgentAdapter.
Sources
- https://developers.openai.com/api/docs/models
- https://developers.openai.com/api/docs/pricing
- https://developers.openai.com/api/docs/guides/text-generation
- https://developers.openai.com/api/docs/guides/migrate-to-responses
- https://developers.openai.com/api/docs/guides/function-calling
- https://developers.openai.com/api/docs/api-reference/chat/create
Anthropic Claude API (Messages)
Fable 5 $10/$50 · Opus 5 + 4.x $5/$25 (Opus 5 / Opus 4.8 fast mode $10/$50) · Sonnet 5 $2/$10 (permanent since 2026-08; the 2026-09-01 rise to $3/$15 was cancelled) · Sonnet 4.x $3/$15 · Haiku 4.5...
LiteLLM Proxy / Gateway
These two defaults are placeholders that signal "unconfigured" — override them with real upstream ids. Underlying provider docs: openai.md, anthropic.md.