# Migrating from the OpenAI API > Keep the OpenAI SDK and reach Claude models by changing the base URL. _Source: https://aiprimetech.io/docs/guides/migration-from-openai/ · Home > Docs > Working with the API_ The gateway exposes an OpenAI-compatible endpoint, so an existing OpenAI codebase can reach Claude models without rewriting request handling. ## Python ```python from openai import OpenAI client = OpenAI( api_key="sk-your-gateway-key", base_url="https://aiprimetech.io/v1", # the /v1 is required here ) resp = client.chat.completions.create( model="claude-sonnet-4-6", # a Claude model through the OpenAI SDK messages=[{"role": "user", "content": "Hello"}], ) ``` ## LangChain ```python from langchain_openai import ChatOpenAI llm = ChatOpenAI( model="claude-sonnet-4-6", api_key="sk-your-gateway-key", base_url="https://aiprimetech.io/v1", ) ``` ## Checklist 1. Set `base_url` to `https://aiprimetech.io/v1` — with the suffix. 2. Swap model ids to ones from [Models](/docs/getting-started/models/). 3. Response parsing is unchanged: `choices[0].message.content`. 4. Streaming is unchanged: `choices[0].delta.content` plus the `[DONE]` sentinel. 5. Function calling uses the OpenAI `tools` shape on this endpoint. > Behaviour differs even when the interface does not. Claude and GPT respond differently to the same prompt, particularly on instruction-following and output formatting. Re-check prompts that depend on a specific style, and re-run evaluations rather than assuming parity. - [Chat Completions](https://aiprimetech.io/docs/api-reference/chat-completions/) — Endpoint reference - [Models](https://aiprimetech.io/docs/getting-started/models/) — Available ids - [Base URLs](https://aiprimetech.io/docs/getting-started/base-urls/) — Why /v1 here --- _ClaudeAPIKey.dev is an independently operated, Anthropic-compatible API gateway. Not affiliated with Anthropic._