# Keep the OpenAI client shape while changing the model route

> An OpenAI-compatible API accepts familiar OpenAI SDK request shapes after you change the base URL, key, and model ID. Compatibility is operation-specific, so KeepRouter lists the supported endpoint on each model page.

_Last reviewed 2026-08-15 · [Editorial review](https://keeprouter.com/editorial-policy#editorial-team)_

## Change configuration before code

For a compatible chat model, set the OpenAI client base URL to `https://keeprouter.com/v1`, provide a KeepRouter API key, and select a catalog model ID. Existing message arrays, streaming flags, and supported tool definitions stay in the OpenAI client shape.

The [OpenAI SDK setup guide](/use-cases/openai-sdk) includes Python and TypeScript examples. The [OpenAPI document](/api/openapi.json) is the machine-readable contract for KeepRouter's public `/v1` routes.

## Compatibility is route-specific

“OpenAI-compatible” should not be read as “every OpenAI endpoint and parameter works for every model.” KeepRouter exposes multiple OpenAI-shaped routes, including Chat Completions and Responses, plus modality-specific endpoints where configured. The selected model must be available on that route, and provider-only parameters may be ignored or rejected.

Before migrating a production workload, verify:

- the model page lists the route your SDK method calls;
- streaming ends in the event format your parser expects;
- tool-call names, arguments, and continuation messages survive a round trip;
- usage fields are present in the final response or stream event;
- timeouts and retry rules treat 4xx and 5xx differently;
- output-token caps are explicit.

## A safer migration sequence

First, send a deterministic non-streaming request. Second, turn on streaming. Third, add tools or structured output. Fourth, replay one representative production prompt and compare token counts and response shape. Finally, move the model ID and key into deployment configuration so rollback does not require a code release.

## When to use the Responses route

Use `/v1/responses` when the selected model and client workflow depend on the Responses object and event model. Use Chat Completions for existing message-based integrations that do not need Responses-specific semantics. The [Responses versus Chat Completions guide](/blog/responses-api-vs-chat-completions) explains the migration trade-off.

## Keep the live catalog in the loop

The catalog is the authority for current model IDs, prices, and route compatibility. Avoid baking a copied model list into your application. Resolve approved IDs at release time, restrict the key to those IDs, and alert when a configured model disappears from your own allowlist or health checks.

## Frequently asked questions

### Can I use the official OpenAI SDK?

Yes, for supported routes. Set the base URL and KeepRouter key, then choose a model that lists the matching endpoint.

### Does every model support the Responses API?

No. Responses support is route and model specific. Check the model page and the live catalog before selecting it.

### Will provider-specific parameters work?

Only when the selected route and upstream support them. Unsupported parameters may be ignored or rejected, so test the exact request shape.

### What should I test before switching the base URL?

Test non-streaming, streaming, tools, usage accounting, errors, timeouts, and the exact production payload with an output cap.

## Sources reviewed

1. [OpenAI API reference](https://platform.openai.com/docs/api-reference)
2. [KeepRouter OpenAPI](https://keeprouter.com/api/openapi.json)

## Related guides

- [openai sdk](https://keeprouter.com/use-cases/openai-sdk.md)
- [OpenAI-compatible API migration checklist](https://keeprouter.com/blog/openai-compatible-api-migration-checklist.md)
- [Responses API vs Chat Completions: choose by contract, not novelty](https://keeprouter.com/blog/responses-api-vs-chat-completions.md)
- [Model routing](https://keeprouter.com/features/model-routing.md)

## Run the same client against a free model

Change the base URL and key, send a bounded request, and inspect the recorded usage.

[Create a free key](https://keeprouter.com/login?returnTo=%2Fconsole%2Fkeys%3Fmodel%3Dfree) · [Live models and pricing](https://keeprouter.com/models.md)
