> ## Documentation Index
> Fetch the complete documentation index at: https://openlayer.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Use any model from any SDK

> Call an Anthropic model with OpenAI code, or the reverse, with automatic translation

When a routing rule sends a request to a provider that speaks a different format than the caller,
the gateway translates it both ways. Your OpenAI code can call an Anthropic model, and your
Anthropic code can call an OpenAI model, with no change on your side.

## How it works

Set up a [routing rule](/docs/gateway/route-requests) that targets a provider in the other format, for
example routing OpenAI-format traffic to an `anthropic` provider. From then on, the gateway:

* Translates the **request** from the OpenAI Responses API to the Anthropic Messages API, or the reverse.
* Translates the **response** back into the format your client expects.
* Translates **streaming** events the same way, so streaming keeps working.

## What's translated

The common shape of a chat request carries over in both directions:

* Messages and the system prompt.
* The max-tokens setting.
* Tools, tool choice, and tool results.
* Streaming, temperature, and top-p.

Settings with no counterpart in the target format are dropped rather than approximated. Anthropic's
`top_k` is one, so a translated request runs without it.

## Endpoints

| Endpoint | API | Translated |
| - | - | - |
| `/v1/responses` | OpenAI Responses API | Yes, to and from `anthropic` |
| `/v1/messages` | Anthropic Messages API | Yes, to and from `openai` |
| `/v1/images/generations` | OpenAI Image Generation API | No, forwarded as-is |

Image generation is a passthrough to an OpenAI-format provider, so it isn't translated and can't be
routed to an `anthropic` upstream. Streaming image generation, the `gpt-image` partial-images mode,
isn't supported: send the request without `stream`.

Keys, usage limits, model access, and guardrails apply on all three endpoints.

## Limits

* Content types beyond text are not translated. A request carrying an image or document block across
  formats fails rather than being silently sent without it.
* The provider-specific tools in the OpenAI Responses API, web search, file search, and code
  interpreter, have no Anthropic counterpart and are not translated.
* The `azure_openai` format is wire-compatible with `openai`, so traffic between them is never translated.

Media that isn't translated between formats is still captured in the
[trace](/docs/gateway/observability#media-in-traces). The limit is on converting it between provider wire
formats, not on recording it.

Which models a key may request is separate from translation: [model access](/docs/gateway/model-access)
rules run on the name the client asked for, before routing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.