Integration options

The public Ambient API page describes three supported integration paths. The first is the official OpenAI SDK, pointed at Ambient as the base URL. This is the cleanest option if your codebase already assumes OpenAI client semantics and you want minimal integration friction.

The second is the official Anthropic SDK, again pointed at Ambient as the base URL. This keeps the Anthropic Messages API shape while routing execution through Ambient infrastructure.

The third is direct HTTP against the Ambient endpoint. This is the most flexible option and the one the docs call out for advanced control, especially when you want to tune reasoning behavior, use the Responses API directly, or work directly with the interactive docs and playground.

OpenAI SDK

Reuse the OpenAI client shape.

Ideal when your application already speaks OpenAI natively and you only want to swap the base URL while keeping the rest of the integration familiar.

from openai import OpenAI client = OpenAI( base_url="https://api.ambient.xyz/v1", api_key=AMBIENT_API_KEY, ) response = client.chat.completions.create( model="zai-org/GLM-5.1-FP8", messages=[{"role": "user", "content": "Hello from Ambient"}], ) response = client.responses.create( model="zai-org/GLM-5.1-FP8", input="Hello from Ambient", )
Anthropic SDK

Use the Messages API format.

Ideal when your stack already relies on Anthropic-style message payloads and you want the same interface style against Ambient infrastructure.

from anthropic import Anthropic client = Anthropic( base_url="https://api.ambient.xyz", api_key=AMBIENT_API_KEY, ) message = client.messages.create( model="zai-org/GLM-5.1-FP8", max_tokens=1024, messages=[{"role": "user", "content": "Hello from Ambient"}], )
Direct HTTP

Use Chat Completions or Responses.

Best when you want explicit control over the raw request surface, tighter tuning, streaming SSE, or easier interoperability outside the canonical SDKs.

curl https://api.ambient.xyz/v1/responses \ -H "Authorization: Bearer $AMBIENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "zai-org/GLM-5.1-FP8", "input": "Hello from Ambient", "stream": true }'

Agent CLI integrations

Ambient can be used from agent-oriented developer tools when the tool lets you route requests to a compatible base URL and model. The Claude Code path below was smoke-tested against Ambient with GLM-5.1. Ambient's raw Responses endpoint is live, but current Codex CLI releases send typed Responses content and tool schemas that Ambient does not yet accept end to end.

Claude Code

Route Claude Code through Ambient.

Claude Code can target Ambient through its Anthropic-compatible gateway settings. Use bearer-token auth with your Ambient API key and select the assigned GLM-5.1 model explicitly.

export AMBIENT_API_KEY="..." export ANTHROPIC_BASE_URL="https://api.ambient.xyz" export ANTHROPIC_AUTH_TOKEN="$AMBIENT_API_KEY" export ANTHROPIC_MODEL="zai-org/GLM-5.1-FP8" export ANTHROPIC_CUSTOM_MODEL_OPTION="zai-org/GLM-5.1-FP8" export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Ambient GLM-5.1 FP8" claude --model "zai-org/GLM-5.1-FP8"
Verified locally: Claude Code returned a successful GLM-5.1 response through Ambient using these environment variables.
Codex CLI

Track Codex payload compatibility.

Codex CLI custom providers now use the Responses wire format. Keep Ambient provider configuration in user-level Codex config, then enable it once Ambient accepts the exact typed input and tool schema payloads Codex sends.

# ~/.codex/config.toml model = "zai-org/GLM-5.1-FP8" model_provider = "ambient" [model_providers.ambient] name = "Ambient" base_url = "https://api.ambient.xyz/v1" env_key = "AMBIENT_API_KEY" wire_api = "responses"
Current status: Ambient's raw /v1/responses endpoint works for simple string input, message arrays with string content, and SSE streaming. Direct Codex CLI routing is still pending because Codex sends typed input_text content and namespace-style tool definitions that are rejected today.

Reference resources

The public docs link to both the interactive API documentation and a ReDoc-rendered reference, along with implementation examples. This page keeps the stable overview on-site and routes endpoint-level detail to the live sources.

Live Docs

Interactive API documentation

Browse endpoints, inspect request and response schemas, and try requests directly in the browser.

Open interactive docs

ReDoc

Reference rendering

Use the ReDoc view when you want a cleaner linear pass through the API surface and schema details.

Open ReDoc reference

Keys

Provision access

Create and manage API credentials before integrating any of the SDK or direct-call paths.

Get API keys