Anthropic-compatible clients

Use the Messages interface with clients that speak the Anthropic protocol.

API guide · Reviewed 11 October 2026

Use the Messages base URL

The Anthropic SDK appends /v1/messages, so its base URL is https://formalengines.com/inference. This differs from the OpenAI SDK base URL, which ends in /v1. The gateway requires Authorization: Bearer; an x-api-key header alone does not authenticate. Configure the Anthropic Python SDK with auth_token=os.environ["ANTHROPIC_AUTH_TOKEN"], or use a client that supports Bearer authentication.

Environment
export ANTHROPIC_BASE_URL="https://formalengines.com/inference"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
curl · Messages endpoint
curl --fail-with-body https://formalengines.com/inference/v1/messages \
  -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
  -H 'anthropic-version: 2023-06-01' \
  -H 'Content-Type: application/json' \
  -d '{"model":"deepseek-v4-1-flash","max_tokens":256,"messages":[{"role":"user","content":"Hello."}]}'

Protocol compatibility

Messages and Chat Completions use different response shapes and streaming events. Parse a Messages response with an Anthropic-compatible client rather than the OpenAI streaming parser. Availability, tool support, and provider-specific features depend on the selected model and route.

For a client that accepts only an OpenAI-compatible endpoint, use the OpenAI quickstart instead. Neither protocol requires you to use a provider-branded model ID; use the IDs from our catalog.

Need a hand? Contact support with your request ID. Keep your API key private.