OpenAI-compatible endpoint backed by a Codex subscription. Best-effort by design: turns run one at a time, take 10–60 s, and every caller must cope with a typed failure. See /healthz · dashboard.
https://ai.altitudecraft.com/v1
codex-gpt-5.6 gpt-5.6-sol gpt-5.6-terra gpt-5.6-luna gpt-5.5 gpt-5.3-codex-spark — append :low / :medium / :high / :xhigh to pick reasoning effort (e.g. codex-gpt-5.6:high).
curl https://ai.altitudecraft.com/v1/chat/completions \
-H "Authorization: Bearer $CODEX_GW_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"codex-gpt-5.6","messages":[{"role":"user","content":"Summarise this ticket: ..."}]}'
from openai import OpenAI
client = OpenAI(base_url="https://ai.altitudecraft.com/v1", api_key=os.environ["CODEX_GW_KEY"], timeout=180, max_retries=0)
r = client.chat.completions.create(
model="codex-gpt-5.6",
messages=[{"role": "user", "content": "..."}],
response_format={"type": "json_object"}, # optional: forces a JSON answer
)
print(r.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://ai.altitudecraft.com/v1", apiKey: process.env.CODEX_GW_KEY, timeout: 180_000, maxRetries: 0 });
const r = await client.chat.completions.create({
model: "codex-gpt-5.6",
messages: [{ role: "user", content: "..." }],
stream: true,
});
for await (const chunk of r) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
| Works | messages (system/user/assistant, text parts), stream, stream_options.include_usage, response_format (json_object, json_schema), model + effort suffix, X-Gateway-Priority header (higher number = lower priority) |
|---|---|
| Ignored | temperature, top_p, max_tokens, penalties, seed, stop, reasoning_effort (use the model suffix) — listed back in the X-Gateway-Ignored response header |
| Rejected (400) | tools / functions (Codex cannot hand tool calls back to you), n > 1 |
| Not available | embeddings, images, audio, /v1/responses |
| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_request · unsupported_parameter | Fix the request |
| 401 | unauthorized | Missing, unknown or revoked key |
| 404 | model_not_found | Not on the model list above |
| 429 | rate_limited · budget_exhausted | Your key's per-minute or per-day allowance; honour Retry-After |
| 429 | queue_full · queue_timeout | Backpressure; honour Retry-After |
| 429 | quota_exhausted | The subscription window is spent |
| 502 | upstream_auth · upstream_unavailable | Codex failed on the host |
| 503 | circuit_open · shutting_down | Failing fast; retry later |
| 504 | exec_timeout | Turn exceeded the limit and was terminated |
Rule of thumb for callers: set a hard timeout, never retry 4xx, retry 429/503 after Retry-After at most once, and make "no answer" a state your feature can ship in.