# Osysharp.Models.OpenAi — OpenAI's models, and anything that speaks the same wire, as a provider

> `Osysharp.Models.OpenAi` is the class that talks to OpenAI's Chat Completions API — and to any endpoint that speaks the same wire: a gateway of your own, a model you host yourself.

<!-- id: agent-kit-openai · area: agent · stability: preview · html: https://osysharp.com/reference/agent/kit-openai/ -->

> **You are here:** [Building with agents](https://osysharp.com/reference/agent/guide/) › [The kits](https://osysharp.com/reference/agent/guide-kits/) › Models.OpenAi

## Summary        {#summary}
`Osysharp.Models.OpenAi` is the class that talks to OpenAI's Chat Completions API — and to any endpoint that speaks the same wire: a gateway of your own, a model you host yourself.

Point `BaseUrl` at another host and the same class serves it. The host is your choice, so your app grants it by name on the `use` line; that grant is the only authority.

|  |  |
|---|---|
| Package | `Osysharp.Models.OpenAi`, version 1.0.0 |
| You add it with | `use Osysharp.Models.OpenAi;` in the app's manifest. |
| It sits on | [[agent-kit-llm\|Llm]] |
| It also uses | `Http` — parts of the platform's own library |
| Its own test app | A recipe box that reads recipes people paste in — `kits/openai/tests` |

## Description    {#description}

### What do you get without writing anything?   {#free}
- Complete and stream, with tools.
- Token counts reported to the meter.

### When do you need it?   {#when}
When your models are OpenAI's, or are served by something OpenAI-compatible.

### What does it expose?   {#exposes}
The tables below are generated from the kit itself, not written by hand: `osy kits Osysharp.Models.OpenAi --surface` lists each of
them with the code of the kit's own test app that uses it, and the tests that show it working.

**Types you use**

| Type | What it is |
|---|---|
| `OpenAiClient` | The OpenAI Chat Completions API as an `ILlmClient`. |
| `OpenAiChatRequest` | What goes UP. |
| `OpenAiStreamOptions` | `include_usage` is what makes a stream meterable. |
| `OpenAiChatResponse` | What comes back from a non-streaming call. |
| `OpenAiChoice` | One choice. |
| `OpenAiToolCall` | One tool call. |
| `OpenAiToolCallFunction` | `arguments` is json *TEXT*, not a document — OpenAI's own shape, and the opposite of Anthropic's `input`. |
| `OpenAiUsage` | The token counts. |
| `OpenAiStreamChunk` | One chunk of a streamed answer. |

## What to read next   {#read-next}
- [Osysharp.Llm — every call to a model: which one, what it may cost, what it did cost](https://osysharp.com/reference/agent/kit-llm/) — every call to a model: which one, what it may cost, what it did cost
- [Osysharp.Models.Gemini — Google's Gemini models as a provider](https://osysharp.com/reference/agent/kit-gemini/) — Google's Gemini models as a provider
- [The map of the kits — which sits on which, and what each one is for](https://osysharp.com/reference/agent/guide-kits/) — the map of the kits — which sits on which, and what each one is for

## Go deeper   {#see-also}
- [[agent-llm-calls#providers]] — how a provider is written and named
- [[agent-llm-calls#models]] — saying which models the app has
