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.OpenAI shape
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?
Themodel 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.