Skip to main content

Start here

Three commands answer most of it before you read any further:

Authentication

The key is missing, malformed, or in the wrong header for the dialect you’re calling. Anthropic-style endpoints take x-api-key; OpenAI-style endpoints take Authorization: Bearer. /v1/messages accepts either. Keys always start with lx1_. See Authentication.
You are still logged in to Claude Code’s own account, which takes precedence over the environment variables. Run /logout first, then re-run npx layerx1. Check ANTHROPIC_BASE_URL is the bare origin — https://api.layerx1.com, with no /v1; the Anthropic SDK appends the path itself.
Codex Desktop does not inherit User environment variables. Re-run npx layerx1 setup --tool codex --key lx1_your_key (0.2.4+) so the key is stored as experimental_bearer_token in ~/.codex/config.toml. See Codex CLI.

Models

The id did not resolve. Check it against GET /v1/models. Unknown ids fail closed rather than silently becoming something else, and the compatibility handles for foreign SDK names are a finite list — an invented id is a 404 by design. See Model routing.
It is a preview id. The Models page marks these in its Availability column: the name is accepted and answered from the serving pool, but no dedicated placement is routed for it yet, so it is not in the endpoint’s list. Pin a Live id for anything whose exact behavior you depend on.
That model does not accept image input. It is a short list — check capabilities.vision on the catalog entry. See Vision.
The request declared a hard requirement (a forced tool_choice, a strict response_format) that no placement of that model declares support for. Switch to a model whose supported_parameters includes it, or drop the requirement.

Output

finish_reason: "length" — you hit max_tokens. On a reasoning model, hidden reasoning is charged against the same ceiling and can consume all of it, leaving nothing for the answer. Raise the budget; 4,000+ is a safe floor on reasoning models. See Reasoning.
Reasoning is hidden unless the request opts in. If you are seeing it, something in your stack is sending thinking, reasoning_effort or reasoning — often an SDK default. Remove it.
A stream that cannot finish ends with a protocol-shaped error event, never a silent truncation — so check for one before assuming the model ran out of things to say. Treat a mid-stream error like a 5xx: retry the whole request with backoff. See Streaming.

Limits and cost

A rate limit — requests/min or concurrency for your plan. Honor retry-after exactly and pace off the x-ratelimit-* headers instead of discovering the limit by hitting it. Parallel agent fleets usually hit concurrency first. See Plans & limits.
The month’s included usage is spent. This is a hard cap: retrying will not clear it — retry-after is the seconds to reset. Upgrading lifts it immediately.
A prepaid balance at zero. There is no reset date to wait for, so there is no retry-after — only a top-up clears it. Branch on the two codes rather than retrying both.
When every model that could serve a request is at capacity, the request queues rather than being shed as a 429. It shows up as latency, not an error — so give client timeouts headroom. See Reliability.
The pool is measured in list-price dollars, so heavier models drain it faster. x1-allowance-remaining on every response is the live figure. Two levers: move the hot path to a cheaper tier, and make the prompt prefix stable so repeated context bills at a cached rate where the model publishes one (Prompt caching).

Getting help

support@layerx1.com

The fastest route for anything not answered above.
Include these and the first reply can usually be the answer rather than a question:
  • What you sent — endpoint, model id, and the request body with secrets removed.
  • What came back — the status code and the full error.message.
  • When — a rough timestamp with timezone, so the trace can be found.
  • The x1-model response header, if you have it — it names what actually served the request.
Never send your API key. If you think one has leaked, revoke it in the dashboard first and tell us second.