Base URL
Base URL
Authentication
Send an inference API key as a bearer token:- Inference keys start with
sk-prl-infapi-; create them on the API Keys page. Management keys (sk-prl-mgmt-) cannot call models. /modelsalso accepts the key in anx-api-keyheader.
Endpoints
Requests
- Bodies are JSON objects, up to 20 MiB. They may be compressed with gzip, br, zstd, or deflate (set
Content-Encoding). - Every response carries an
X-Request-IDheader. Send your own UUID inX-Request-IDto use it as the ID. Include the ID when you contact support. - Streaming responses are server-sent events. An error after the stream starts arrives as an event in the stream, not as an HTTP status, see Streaming.
Errors
Errors are JSON in OpenAI’s shape, with the request ID in the body.type is one of invalid_request_error, authentication_error, permission_error, rate_limit_error, or api_error, and code is present only when set.
Status codes
Retry
429 and 5xx with exponential backoff and jitter, honoring Retry-After when present. A 400, 401, 402, 403, or 404 fails the same way until the request, key, balance, or endpoint changes.Rate limits
Limits apply per organization and model: requests, input tokens, and output tokens per minute, and concurrent requests. Your plan sets them, see Plans & rate limits. Over a limit, a request gets429 with a Retry-After header in seconds.
Anthropic-compatible endpoints
/messagesand/messages/count_tokensaccept the key in anx-api-keyheader, as the Anthropic SDK sends it, or as a bearer token. If you send both headers, they must carry the same key.- They require an
anthropic-versionheader (any single value, for example2023-06-01) andContent-Type: application/json. - Their errors use Anthropic’s shape, and their responses also carry the ID in a
request-idheader: