Anthropic-compatible messages (drop-in)
Use when: caller has an existing Anthropic SDK Messages-API flow and wants to route through Layer with zero code changes via baseURL swap
Drop-in replacement for POST https://api.anthropic.com/v1/messages. Accepts the upstream Anthropic Messages API request body verbatim and returns the upstream Anthropic response body verbatim — including streaming SSE chunks when stream: true. Route through a Layer gate by passing model as a Layer gate id or name. Existing Anthropic SDK clients work unmodified by changing the baseURL to https://api.uselayer.ai/v1/. Errors are returned in the Anthropic wrapped shape ({ type: 'error', error: { type, message } }) so the Anthropic SDK’s error parser handles them transparently.
Documentation Index
Fetch the complete documentation index at: https://docs.verlon.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Layer API key (prefixed sk-). Generated from the dashboard under Settings → API Keys, or via layer key create in the CLI.
Response
Anthropic-format messages response. Shape matches the underlying provider format selected by the gate. For streaming requests, returns SSE chunks instead of a single JSON body.