Skip to main content

curl (Generic HTTP)

Any AI runtime that speaks HTTP can call an LLM Registry endpoint — this page shows the raw curl calls for each provider so you can adapt them to your own scripts, integrations, or one-off tests.

The gateway accepts each provider's native wire shape. The path suffix and body stay the same as if you were calling the provider directly; only the host name and the auth headers change:

  • The Agent Access Key authenticates the caller to the gateway. It rides on X-Agent-Key (or, for clients that only expose one auth slot, on Authorization: Bearer or x-goog-api-key).
  • When the entry runs in passthrough mode, the provider credential travels alongside — the gateway forwards it to the provider unchanged.

Setup

Pick your provider and mode.

The gateway stores the OpenAI credential on the entry, so the caller sends only its Agent Access Key.

curl -X POST "https://<gateway-host>/llm/<url-prefix>/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "X-Agent-Key: <your-agent-access-key>" \
-d '{"model":"<model-id>","messages":[{"role":"user","content":"Hello"}]}'

The model in the body must be one the entry's Allowed Models list permits (unless the entry allows all models).

Where to find each value

PlaceholderWhere to find it
<gateway-host>Host from the LLM Registry entry's Overview tab (e.g., gw.aigateway.example.com)
<url-prefix>The URL prefix field on the entry's Overview tab
<model-id>The provider's model identifier, from the entry's Allowed Models list
<inference-profile-id>Bedrock inference-profile ID (e.g., global.anthropic.claude-sonnet-4-6)
<vendor>/<model>OpenRouter model in vendor-scoped form (e.g., openai/gpt-5.1)
<your-agent-access-key>Generate from the LLM Registry entry's Agent Access Keys step; plaintext is shown once
<your-*-api-key>Your provider's own API key — only needed in passthrough mode

Tips

  • Anthropic-version header is mandatory. Anthropic 400s any call to /v1/messages that omits anthropic-version, whether or not the provider credential is stored by the gateway.
  • Streaming is transparent. Add "stream": true to the body (or ?alt=sse for Gemini's native path); the gateway forwards the stream unchanged.