Skip to content
Connect a clientMigrating from OpenAI

Migrating from OpenAI

A one-line base URL swap.

Set up with your own AI
Model protocol

In the OpenAI SDK, replace base_url and the key, then set an exact Guard model. Check other fields against the selected family and API contract: compatibility does not imply every OpenAI feature is supported.

diff
  from openai import OpenAI
  client = OpenAI(
-     api_key=OPENAI_KEY,
+     api_key=GUARD_KEY,
+     base_url="https://api.guardrelay.ai/v1",
  )

Set a Claude model such as claude-sonnet-5 instead of an OpenAI model, and check parameters against Chat Completions.

Kimi, Composer and Grok

For another family, set its exact model and check the fields supported by the selected API. The address and key stay shared.

FamilyWhat goes in modelEndpoint
Claudeclaude-sonnet-5, claude-opus-5, claude-haiku-4-5/v1/chat/completions, /v1/messages, /v1/responses
Kimik3, k3-256k, kimi-for-coding, kimi-for-coding-highspeed/v1/chat/completions, /v1/messages, /v1/responses
Composercomposer-2.5, composer-2.5-fast/v1/chat/completions, /v1/messages, /v1/responses
Grokcursor-grok-4.6-high and the other 7 IDs/v1/chat/completions, /v1/messages, /v1/responses

Documentation sections

On this page