Skip to main content
Move an application that calls OpenAI or Anthropic directly onto Model Gateway. You change three things: the base URL, the API key, and the model name. Your messages, tools, and streaming code stay as they are. Either dialect reaches every chat model your organization connects, so you don’t have to match the SDK to the provider.

Before you begin

  • You have an Atlan agent key in ATLAN_API_KEY. See Connect client to Model Gateway to create one.
  • You have the id of each model you’ll call, from GET /openai/v1/models.
  • Every operation your code calls is served. Files, batches, assistants, vector stores, fine-tuning, and Anthropic token counting aren’t; see Model API compatibility.
1

Change the client configuration

Pick your library and change the client setup.
Before
After
2

Replace each model name

Swap every model id for the gateway’s qualified name. A bare vendor id, without the provider part, returns 404 with model not found.
3

Check the fields you send

Fields that only tune or annotate a request, such as metadata or seed, are dropped when the serving provider has no place for them, and named in the x-gateway-model-dropped response header. Fields that change the reply, such as logprobs, are refused with 400 when the provider can’t honor them. If you use the Responses API, send the whole conversation each time: previous_response_id and stored conversations are refused.

Verify

  1. Run your application. It answers as before.
  2. Inspect one response’s headers: x-gateway-model-wire names the provider API that served it.
  3. In Model Gateway studio, an organization admin finds the agent’s calls on Agents and in Usage. See Review model usage.
If a call fails, look up its status in Model Gateway errors.