Home/Docs/API referenceAPI referenceLayerCloud AI exposes one OpenAI-compatible API plus an Anthropic-compatible path for Claude Code. This page is the short version: where to send requests, how to authenticate, and what to call first.Base URL and pathsEverything is served from https://ai.layercloud.org. OpenAI-compatible paths sit under /v1; the Anthropic-compatible path sits on the root so Claude Code needs no rewrite.POST /v1/chat/completions - chat, streaming, tools, structured outputPOST /v1/messages - Anthropic protocol, used by Claude CodeGET /v1/models - live model ids and context windowsPOST /v1/embeddings - text to vectorsGET /v1/models is the authority for ids; vendor names return 404AuthenticationOne header: Authorization: Bearer <key>. Keys are created in the panel, shown once, and can carry their own quota. Create one token per device so a leak costs one token rather than the account.First requestSend one plain request before configuring an editor. A response with choices means the key and the model id are correct.curl https://ai.layercloud.org/v1/chat/completions -H "Authorization: Bearer $LAYERCLOUD_API_KEY" -H "Content-Type: application/json" -d '{"model":"deepseek/deepseek-v4.1-flash","messages":[{"role":"user","content":"hi"}]}'Client setupClaude Code: ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, model in ANTHROPIC_MODELCursor: Override OpenAI Base URL plus a custom model entryopencode / Kilo Code: a provider block in their configSDKs: OpenAI client with base_url set to https://ai.layercloud.org/v1BillingPer token, in USD, at roughly a quarter of official list price; top-ups are in rial from 300,000 toman and the balance is shared across every model. Client errors are not billed - only a successful response with its usage is.Related pagesAuthenticationChat completionsModels and model idsErrors and retriesModel catalogue and prices