# OpenAI

Add OpenAI's API as a provider, with an organization or project of your account, and call GPT models through the LLM Gateway.

Connect OpenAI's API using your API key to serve GPT and o-series models such as `gpt-5-mini`. Adding a provider requires Owner or LLM Gateway Admin on the organization, or on a project for a project-scoped provider.

## Add OpenAI [#add-openai]

1. Create an API key in [OpenAI's platform](https://platform.openai.com/api-keys).
2. In your organization, click **LLM Gateway**, then **Providers**, then **Add a provider**, then **OpenAI** under **Model providers**.
3. For a key that belongs to several OpenAI organizations or projects, enter the **Organization ID (optional)**, `org-…`, or the **Project ID (optional)**, `proj_…`, that requests count against.
4. Paste the key into **API key**, select which projects can create models with this provider, click **Test** and click **Add provider**.

See [Add a provider](/guides/llm-gateway/add-a-provider) for adding a project provider, sharing and key rotation.

## What kosem uses [#what-kosem-uses]

- **API:** OpenAI's Responses and Chat Completions at `https://api.openai.com/v1`. kosem translates calls with Anthropic's Messages to Responses.
- **Type, for the API:** `providerTypes/openai`, with `organization` and `project` in `config`.
- **Models to start with:** `gpt-6.2-sol` and `gpt-5-mini`. The provider list omits models the LLM Gateway doesn't serve, such as embedding, speech, image and realtime models.
- **Prices:** OpenAI's list prices, for usage and spend limits.

Through Anthropic's SDK, token counting returns `501` for OpenAI models, since only Anthropic supports token counting; SDKs then fall back to local estimation.

## Related [#related]

- [Add a provider](/guides/llm-gateway/add-a-provider)
- [Call models from your code](/guides/llm-gateway/call-models-from-code)
- [Compatible servers](/guides/llm-gateway/providers/compatible-servers), for other OpenAI-compatible endpoints
