Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions GOALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ platform, security, or legal requirements.
- **N5. Features accepted solely through popularity or AI recommendations.**
Community interest and agent suggestions can inform a discussion. They do not
decide project direction or authorize a feature.
- **N6. A directory or promotional channel for commercial providers.** Document
integration mechanisms rather than listing or endorsing gateway services.
Use fictional companies and clearly identified placeholder endpoints, such as
`adatum.com`, for generic gateway examples. Provider names remain appropriate
when needed to explain APIs or adapters TypeChat implements, such as OpenAI
and Azure OpenAI. This does not remove support for compatible endpoints.

Existing supported integrations and examples are not automatically deprecated
by these boundaries. Preserve existing contributions and contributor credit.
Expand Down
11 changes: 9 additions & 2 deletions site/src/docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,18 @@ AZURE_OPENAI_ENDPOINT=...
AZURE_OPENAI_API_KEY=...
```

The examples also work against any OpenAI-compatible gateway, such as [OrcaRouter](https://www.orcarouter.ai), by pointing `OPENAI_ENDPOINT` at the gateway's Chat Completions URL in addition to the OpenAI variables above:
The examples also work against any OpenAI-compatible gateway. Set
`OPENAI_ENDPOINT` to the gateway's Chat Completions URL and use the gateway's API
key and model name for `OPENAI_API_KEY` and `OPENAI_MODEL`.

The URL below uses a fictional Adatum gateway at `api.adatum.com`, not a live
service. Replace it with your gateway's actual Chat Completions URL:

```
# Optional: use an OpenAI-compatible gateway instead of api.openai.com
OPENAI_ENDPOINT=https://api.orcarouter.ai/v1/chat/completions
OPENAI_API_KEY=<your API key>
OPENAI_MODEL=<model name>
OPENAI_ENDPOINT=https://api.adatum.com/v1/chat/completions
```

## Step 4: Run the examples
Expand Down
13 changes: 8 additions & 5 deletions site/src/docs/python/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,16 @@ Responses requests always omit temperature, regardless of this option.
#### Using OpenAI-compatible gateways

TypeChat works with any service that exposes the OpenAI Chat Completions API.
To use a gateway such as [OrcaRouter](https://www.orcarouter.ai) or OpenRouter,
point `create_openai_language_model` at the gateway's endpoint via the
`endpoint` argument:
To use a gateway, point `create_openai_language_model` at its Chat Completions
URL via the `endpoint` argument.

The examples below use a fictional Adatum gateway at `api.adatum.com`, not a live
service. Replace the URL with your gateway's Chat Completions URL and use that
gateway's API key and model name:

```py
model = create_openai_language_model(
api_key, model, endpoint="https://api.orcarouter.ai/v1/chat/completions"
api_key, model, endpoint="https://api.adatum.com/v1/chat/completions"
)
```

Expand All @@ -334,7 +337,7 @@ the gateway's Chat Completions URL alongside `OPENAI_API_KEY` and
```
OPENAI_API_KEY=<your API key>
OPENAI_MODEL=<model name>
OPENAI_ENDPOINT=https://api.orcarouter.ai/v1/chat/completions
OPENAI_ENDPOINT=https://api.adatum.com/v1/chat/completions
```

The HTTP models returned by `create_language_model`,
Expand Down
13 changes: 8 additions & 5 deletions site/src/docs/typescript/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,15 @@ resolved responses visible to TypeChat, not HTTP attempts hidden inside the clie
#### Using OpenAI-compatible gateways

TypeChat works with any service that exposes the OpenAI Chat Completions API.
To use a gateway such as [OrcaRouter](https://www.orcarouter.ai) or OpenRouter,
point `createOpenAILanguageModel` at the gateway's endpoint via the `endPoint`
argument:
To use a gateway, point `createOpenAILanguageModel` at its Chat Completions URL
via the `endPoint` argument.

The examples below use a fictional Adatum gateway at `api.adatum.com`, not a live
service. Replace the URL with your gateway's Chat Completions URL and use that
gateway's API key and model name:

```ts
const model = createOpenAILanguageModel(apiKey, model, "https://api.orcarouter.ai/v1/chat/completions");
const model = createOpenAILanguageModel(apiKey, model, "https://api.adatum.com/v1/chat/completions");
```

With `createLanguageModel`, set the `OPENAI_ENDPOINT` environment variable to
Expand All @@ -181,7 +184,7 @@ the gateway's Chat Completions URL alongside `OPENAI_API_KEY` and
```
OPENAI_API_KEY=<your API key>
OPENAI_MODEL=<model name>
OPENAI_ENDPOINT=https://api.orcarouter.ai/v1/chat/completions
OPENAI_ENDPOINT=https://api.adatum.com/v1/chat/completions
```

Regardless, of how you decide to construct your model, it is important to avoid committing credentials directly in source.
Expand Down
Loading