Skip to main content
Relay accepts the OpenAI and Anthropic wire shapes, so the official SDKs work against it unchanged: set the SDK’s base URL to Relay and use your relay key (or an inference token) as the API key. Relay reads the credential whether the SDK sends it as a bearer token or as an x-api-key header. The model you name does not have to belong to the SDK’s vendor. Relay routes it through your policy and translates between shapes, so the OpenAI SDK can call a Claude model and the Anthropic SDK an OpenAI one. Embeddings are the exception: they are forwarded unchanged and need a model with an adapter: openai binding.
Swap http://localhost:8080 for your relay’s public URL in production. SDK traffic goes to the inference port (8080 by default), not the control port.
For coding agents, use their dedicated base URLs instead: Claude Code, Codex CLI, OpenCode. For Go, the Go SDK speaks Relay’s canonical shape.

OpenAI shape

The same client reaches the Responses API and embeddings:
Python

Anthropic shape

Streaming

Both SDKs stream as usual. When the upstream speaks the same shape, Relay passes the event stream through byte for byte; otherwise it translates each event.

Relay headers from an SDK

Both SDKs let you add headers per client, which is how you send Relay’s own request headers, such as usage tags or a host pin. See Headers.

Which models can I call?

The model you pass must be granted by the policy that governs your relay key and have an enabled host binding. List what your key can reach:
GET /openai/v1/models, which the OpenAI SDK’s client.models.list() calls, returns the same list limited to models with an enabled adapter: openai binding. See Troubleshooting if a model returns 403 or 404, and Errors for every error code.