### Re-run OpenClaw Setup Source: https://teamorouter.com/docs/install-openclaw Use this command to re-enter the setup process for an existing OpenClaw installation to switch providers. ```bash openclaw onboard --install-daemon ``` -------------------------------- ### Install OpenClaw Source: https://teamorouter.com/docs/install-openclaw Commands to install OpenClaw from scratch on different operating systems. ```bash curl -fsSL https://openclaw.ai/install.sh | bash ``` ```powershell iwr -useb https://openclaw.ai/install.ps1 | iex ``` -------------------------------- ### Install Gemini CLI Source: https://teamorouter.com/docs/install-gemini-cli Commands to install the Gemini CLI using Homebrew or npm. ```bash brew install gemini-cli ``` ```bash npm install -g @google/gemini-cli ``` -------------------------------- ### Install Kimi Code CLI via Script Source: https://teamorouter.com/docs/install-kimi-code Use the official install script for macOS, Linux, or Windows PowerShell. ```bash curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash ``` ```powershell irm https://code.kimi.com/kimi-code/install.ps1 | iex ``` -------------------------------- ### Setup Hermes Agent Source: https://teamorouter.com/docs/install-cc-switch Initialize the Hermes Agent setup process after configuring the provider in CC Switch. ```plaintext hermes setup ``` -------------------------------- ### Launch Kimi Code CLI Source: https://teamorouter.com/docs/install-kimi-code Start the Kimi Code CLI after configuration is complete. ```bash kimi ``` -------------------------------- ### Install Kimi Code CLI via Package Manager Source: https://teamorouter.com/docs/install-kimi-code Install the Kimi Code package globally using npm or pnpm. ```bash npm install -g @moonshot-ai/kimi-code ``` ```bash pnpm add -g @moonshot-ai/kimi-code ``` -------------------------------- ### Install Codex CLI Source: https://teamorouter.com/docs/install-codex Global installation of the Codex CLI package via npm. ```plaintext npm install -g @openai/codex ``` -------------------------------- ### Verify Codex Installation Source: https://teamorouter.com/docs/install-codex Check the installed version of the Codex CLI. ```plaintext codex --version ``` -------------------------------- ### Retrieve token usage request example Source: https://teamorouter.com/docs/open-api Example cURL request for the token usage endpoint using an API key. ```bash curl "$TEAMO_BASE_URL/v1/usage?start_time=1784044800&end_time=1784131200" \ -H "Authorization: Bearer $TEAMO_API_KEY" ``` -------------------------------- ### Launch Claude Code Source: https://teamorouter.com/docs/install-claude-code Starts the Claude Code CLI application. ```bash claude ``` -------------------------------- ### Fast Mode with Python SDK Source: https://teamorouter.com/docs/api-integration Example of enabling Fast mode using the Python SDK. ```python from openai import OpenAI client = OpenAI( api_key="sk-teamo-xxxxxx", base_url="https://api.teamorouter.com/v1", ) resp = client.responses.create( model="gpt-5.6-sol", input="Analyze this requirement for me", service_tier="fast", ) print(resp.output_text) ``` -------------------------------- ### Install Claude Code CLI Source: https://teamorouter.com/docs/install-claude-code Installs the Claude Code package globally using npm. ```bash npm install -g @anthropic-ai/claude-code ``` -------------------------------- ### Verify Node.js Version Source: https://teamorouter.com/docs/install-kimi-code Check the installed Node.js version before proceeding with npm installation. ```bash node --version ``` -------------------------------- ### Fast Mode with JavaScript SDK Source: https://teamorouter.com/docs/api-integration Example of enabling Fast mode using the JavaScript SDK. ```javascript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "sk-teamo-xxxxxx", baseURL: "https://api.teamorouter.com/v1", }); const resp = await client.responses.create({ model: "gpt-5.6-sol", input: "Analyze this requirement for me", service_tier: "fast", }); console.log(resp.output_text); ``` -------------------------------- ### Retrieve billing costs request example Source: https://teamorouter.com/docs/open-api Example cURL request for the billing costs endpoint using an API key. ```bash curl "$TEAMO_BASE_URL/v1/billing/costs?start_time=1784044800&end_time=1784131200" \ -H "Authorization: Bearer $TEAMO_API_KEY" ``` -------------------------------- ### Retrieve token usage response example Source: https://teamorouter.com/docs/open-api Sample JSON response containing detailed token usage metrics. ```json { "start_time": 1784044800, "end_time": 1784131200, "usage": { "input_tokens": 120000, "output_tokens": 30000, "cached_write_tokens": 10000, "cached_read_tokens": 80000, "total_tokens": 240000 }, "requests": 86 } ``` -------------------------------- ### Verify Claude Code Installation Source: https://teamorouter.com/docs/install-claude-code Checks the installed version of the Claude Code CLI. ```bash claude --version ``` -------------------------------- ### Install CC Switch on macOS via Homebrew Source: https://teamorouter.com/docs/install-claude-desktop Use the Homebrew package manager to install the CC Switch application on macOS systems. ```bash brew install --cask cc-switch ``` -------------------------------- ### Retrieve billing costs response example Source: https://teamorouter.com/docs/open-api Sample JSON response containing billing totals and request count. ```json { "start_time": 1784044800, "end_time": 1784131200, "total_amount": { "value": "1.280000", "currency": "USD" }, "requests": 86 } ``` -------------------------------- ### Retrieve account balance request Source: https://teamorouter.com/docs/open-api Example request using cURL to authenticate with the billing balance endpoint. ```bash curl "$TEAMO_BASE_URL/v1/billing/balance" \ -H "Authorization: Bearer $TEAMO_API_KEY" ``` -------------------------------- ### Example API Response Source: https://teamorouter.com/docs/api-integration The expected JSON response structure for a successful message request. ```json { "id": "msg_01KxDE...", "type": "message", "role": "assistant", "model": "claude-fable-5", "content": [{"type": "text", "text": "I am Claude..."}], "stop_reason": "end_turn", "usage": {"input_tokens": 159, "output_tokens": 34} } ``` -------------------------------- ### Request Billing for a Specific ID Source: https://teamorouter.com/docs/open-api Example cURL command to retrieve usage and billing for a specific request. ```bash curl "$TEAMO_BASE_URL/v1/billing/requests/550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer $TEAMO_API_KEY" ``` -------------------------------- ### GET /v1/models Source: https://teamorouter.com/docs/api-integration Fetches the complete list of available models supported by the TeamoRouter gateway. ```APIDOC ## GET /v1/models ### Description Retrieves a list of all models currently available through the TeamoRouter gateway. ### Method GET ### Endpoint https://api.teamorouter.com/v1/models ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token using your TeamoRouter API key (e.g., "Bearer sk-teamo-xxxxxx") ### Request Example curl https://api.teamorouter.com/v1/models \ -H "Authorization: Bearer sk-teamo-xxxxxx" ``` -------------------------------- ### Select TeamoRouter in Hermes Source: https://teamorouter.com/docs/install-cc-switch The expected output format when selecting the custom provider within the Hermes setup wizard. ```plaintext teamorouter (api.teamorouter.com/v1) - model-name ``` -------------------------------- ### GET /v1/billing/balance Source: https://teamorouter.com/docs/open-api Retrieve the available balance for the account associated with the current API key. ```APIDOC ## GET /v1/billing/balance ### Description Retrieve the available balance for the account associated with the current API key. ### Method GET ### Endpoint /v1/billing/balance ### Request Example curl "$TEAMO_BASE_URL/v1/billing/balance" \ -H "Authorization: Bearer $TEAMO_API_KEY" ### Response #### Success Response (200) - **balance** (object) - The account balance details. - **value** (string) - The balance amount. - **currency** (string) - The currency code. #### Response Example { "balance": { "value": "85.320000", "currency": "USD" } } ``` -------------------------------- ### GET /v1/usage Source: https://teamorouter.com/docs/open-api Retrieve aggregate token usage for the authenticated API key over a specified time range. ```APIDOC ## GET /v1/usage ### Description Retrieve aggregate token usage for the authenticated API key over a time range. ### Method GET ### Endpoint /v1/usage ### Parameters #### Query Parameters - **start_time** (integer) - Required - Start of the query range, inclusive - **end_time** (integer) - Required - End of the query range, exclusive ### Request Example curl "$TEAMO_BASE_URL/v1/usage?start_time=1784044800&end_time=1784131200" \ -H "Authorization: Bearer $TEAMO_API_KEY" ### Response #### Success Response (200) - **start_time** (integer) - Start of the query range - **end_time** (integer) - End of the query range - **usage** (object) - Token usage breakdown - **requests** (integer) - Total number of requests #### Response Example { "start_time": 1784044800, "end_time": 1784131200, "usage": { "input_tokens": 120000, "output_tokens": 30000, "cached_write_tokens": 10000, "cached_read_tokens": 80000, "total_tokens": 240000 }, "requests": 86 } ``` -------------------------------- ### Fetch Model List via cURL Source: https://teamorouter.com/docs/api-integration Retrieve the list of available models using the GET /v1/models endpoint with an authorization header. ```bash curl https://api.teamorouter.com/v1/models \ -H "Authorization: Bearer sk-teamo-xxxxxx" ``` -------------------------------- ### GET /v1/billing/costs Source: https://teamorouter.com/docs/open-api Retrieve billing totals for the authenticated API key over a specified time range. The response provides aggregate cost data. ```APIDOC ## GET /v1/billing/costs ### Description Retrieve billing totals for the authenticated API key over a time range. The basic response contains aggregate data only, not individual request records. ### Method GET ### Endpoint /v1/billing/costs ### Parameters #### Query Parameters - **start_time** (integer) - Required - Start of the query range, inclusive - **end_time** (integer) - Required - End of the query range, exclusive ### Request Example curl "$TEAMO_BASE_URL/v1/billing/costs?start_time=1784044800&end_time=1784131200" \ -H "Authorization: Bearer $TEAMO_API_KEY" ### Response #### Success Response (200) - **start_time** (integer) - Start of the query range - **end_time** (integer) - End of the query range - **total_amount** (object) - Total cost object containing value and currency - **requests** (integer) - Total number of requests #### Response Example { "start_time": 1784044800, "end_time": 1784131200, "total_amount": { "value": "1.280000", "currency": "USD" }, "requests": 86 } ``` -------------------------------- ### GET /v1/billing/requests/{request_id} Source: https://teamorouter.com/docs/open-api Retrieve token usage and billing details for a specific model request using its unique request ID. ```APIDOC ## GET /v1/billing/requests/{request_id} ### Description Retrieve token usage and final charge for one specific model call using its request ID. ### Method GET ### Endpoint /v1/billing/requests/{request_id} ### Parameters #### Path Parameters - **request_id** (UUID string) - Required - Request ID returned by the model call ### Request Example curl "$TEAMO_BASE_URL/v1/billing/requests/550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer $TEAMO_API_KEY" ### Response #### Success Response (200) - **request_id** (string) - Request ID - **created_at** (integer) - Timestamp of the request - **model** (string) - Model name - **usage** (object) - Token usage details - **amount** (object) - Billing amount and currency #### Response Example { "request_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": 1784081234, "model": "gpt-5.4", "usage": { "input_tokens": 1000, "output_tokens": 500, "cached_write_tokens": 800, "cached_read_tokens": 200, "total_tokens": 2500 }, "amount": { "value": "0.012680", "currency": "USD" } } ``` -------------------------------- ### Configure Codex Desktop on macOS and Linux Source: https://teamorouter.com/docs Creates the configuration directory and writes the TeamoRouter settings to the config.toml file. ```bash mkdir -p ~/.codex && cat > ~/.codex/config.toml <<'EOF' model_provider = "teamorouter" model = "gpt-5.6-sol" model_reasoning_effort = "high" [model_providers.teamorouter] name = "TeamoRouter" base_url = "https://api.teamorouter.com/v1" env_key = "OPENAI_API_KEY" wire_api = "responses" EOF ``` -------------------------------- ### Configure Codex Desktop on Windows Source: https://teamorouter.com/docs Creates the configuration directory and writes the TeamoRouter settings to the config.toml file using PowerShell. ```powershell New-Item -ItemType Directory -Force -Path "$HOME\.codex" | Out-Null @' model_provider = "teamorouter" model = "gpt-5.6-sol" model_reasoning_effort = "high" [model_providers.teamorouter] name = "TeamoRouter" base_url = "https://api.teamorouter.com/v1" env_key = "OPENAI_API_KEY" wire_api = "responses" '@ | Set-Content -Path "$HOME\.codex\config.toml" -Encoding UTF8 ``` -------------------------------- ### Launch OpenClaw Interfaces Source: https://teamorouter.com/docs/install-openclaw Commands to launch the various OpenClaw user interfaces after configuration. ```bash openclaw dashboard ``` ```bash openclaw tui ``` ```bash openclaw terminal ``` -------------------------------- ### Configure Kimi Code Environment Variables Source: https://teamorouter.com/docs/install-kimi-code Set the required environment variables to route Kimi Code through TeamoRouter. Replace the placeholder with your actual API key. ```bash SHELL_RC="$HOME/.zshrc"; case "$SHELL" in *bash*) SHELL_RC="$HOME/.bashrc";; esac cat >> "$SHELL_RC" <<'EOF' export KIMI_MODEL_NAME=kimi-k3 export KIMI_MODEL_PROVIDER_TYPE=openai export KIMI_MODEL_API_KEY=your TeamoRouter API Key export KIMI_MODEL_BASE_URL=https://api.teamorouter.com/v1 export KIMI_MODEL_MAX_CONTEXT_SIZE=1048576 EOF source "$SHELL_RC" ``` ```powershell $env:KIMI_MODEL_NAME = "kimi-k3" $env:KIMI_MODEL_PROVIDER_TYPE = "openai" $env:KIMI_MODEL_API_KEY = "your TeamoRouter API Key" $env:KIMI_MODEL_BASE_URL = "https://api.teamorouter.com/v1" $env:KIMI_MODEL_MAX_CONTEXT_SIZE = "1048576" ``` -------------------------------- ### Perform a basic Gemini content generation request Source: https://teamorouter.com/docs/api-integration Sends a POST request to the generateContent endpoint with a user prompt. ```bash curl https://api.teamorouter.com/v1beta/models/gemini-3.5-flash:generateContent \ -H "Authorization: Bearer sk-teamo-xxxxxx" \ -H "content-type: application/json" \ -d '{ "contents": [ {"role": "user", "parts": [{"text": "Introduce yourself in one sentence"}]} ] }' ``` -------------------------------- ### Configure environment variables for Gemini SDKs Source: https://teamorouter.com/docs/api-integration Sets the base URL and authentication credentials for SDKs that support custom endpoint configuration. ```bash export GOOGLE_GEMINI_BASE_URL="https://api.teamorouter.com" export GEMINI_API_KEY="sk-teamo-xxxxxx" export GEMINI_API_KEY_AUTH_MECHANISM="bearer" ``` -------------------------------- ### Configure Gemini CLI environment variables Source: https://teamorouter.com/docs/install-gemini-cli Creates the configuration directory and sets the environment variables required to route requests through TeamoRouter. ```bash mkdir -p ~/.gemini && cat > ~/.gemini/.env <<'EOF' GOOGLE_GEMINI_BASE_URL=https://api.teamorouter.com GEMINI_API_KEY=sk-teamo- GEMINI_API_KEY_AUTH_MECHANISM=bearer EOF ``` -------------------------------- ### Configure Agent Tool Environment Variables Source: https://teamorouter.com/docs/api-integration Points various CLI tools to the TeamoRouter API by setting base URL and API key environment variables. ```bash export ANTHROPIC_BASE_URL="https://api.teamorouter.com" export ANTHROPIC_API_KEY="sk-teamo-xxxxxx" ``` ```bash export OPENAI_BASE_URL="https://api.teamorouter.com/v1" export OPENAI_API_KEY="sk-teamo-xxxxxx" ``` ```bash export GOOGLE_GEMINI_BASE_URL="https://api.teamorouter.com" export GEMINI_API_KEY="sk-teamo-xxxxxx" export GEMINI_API_KEY_AUTH_MECHANISM="bearer" ``` -------------------------------- ### Configure TeamoRouter Provider Source: https://teamorouter.com/docs/install-codex Create the configuration file for TeamoRouter on different operating systems. ```plaintext mkdir -p ~/.codex && cat > ~/.codex/config.toml <<'EOF' model_provider = "teamorouter" model = "gpt-5.6-sol" model_reasoning_effort = "high" [model_providers.teamorouter] name = "TeamoRouter" base_url = "https://api.teamorouter.com/v1" env_key = "OPENAI_API_KEY" wire_api = "responses" EOF ``` ```plaintext New-Item -ItemType Directory -Force -Path "$HOME\.codex" | Out-Null @' model_provider = "teamorouter" model = "gpt-5.6-sol" model_reasoning_effort = "high" [model_providers.teamorouter] name = "TeamoRouter" base_url = "https://api.teamorouter.com/v1" env_key = "OPENAI_API_KEY" wire_api = "responses" '@ | Set-Content -Path "$HOME\.codex\config.toml" -Encoding UTF8 ``` -------------------------------- ### Fast Mode Configuration Source: https://teamorouter.com/docs/api-integration Enable Fast mode by adding the service_tier parameter to your request. ```json "service_tier": "fast" ``` -------------------------------- ### Run OpenCode from terminal Source: https://teamorouter.com/docs/install-opencode Command to launch the OpenCode application from the command line. ```plaintext opencode ``` -------------------------------- ### Enable Fast Mode Source: https://teamorouter.com/docs/install-codex Toggle Fast mode within the CLI or set it permanently in the configuration file. ```bash /fast ``` ```toml service_tier = "fast" ``` -------------------------------- ### Configure Environment Variables for Windows Source: https://teamorouter.com/docs/install-claude-code Sets persistent user-level environment variables for TeamoRouter using PowerShell. ```powershell setx ANTHROPIC_BASE_URL "https://api.teamorouter.com" setx ANTHROPIC_AUTH_TOKEN "your TeamoRouter API Key" setx ANTHROPIC_MODEL "claude-opus-4-8" setx ANTHROPIC_DEFAULT_FABLE_MODEL "claude-fable-5" setx ANTHROPIC_DEFAULT_OPUS_MODEL "claude-opus-4-8" setx ANTHROPIC_DEFAULT_SONNET_MODEL "claude-sonnet-5" setx ANTHROPIC_DEFAULT_HAIKU_MODEL "claude-haiku-4-5" setx CLAUDE_CODE_SUBAGENT_MODEL "claude-sonnet-5" setx CLAUDE_CODE_EFFORT_LEVEL "xhigh" ``` -------------------------------- ### Python SDK Integration Source: https://teamorouter.com/docs/api-integration Configures the Anthropic client to point to the TeamORouter base URL for message creation. ```python from anthropic import Anthropic client = Anthropic( api_key="sk-teamo-xxxxxx", base_url="https://api.teamorouter.com", ) resp = client.messages.create( model="claude-fable-5", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}], ) print(resp.content[0].text) ``` -------------------------------- ### Configure Environment Variables for Linux and macOS Source: https://teamorouter.com/docs/install-claude-code Appends TeamoRouter configuration to the shell profile and sources it. ```bash SHELL_RC="$HOME/.zshrc"; case "$SHELL" in *bash*) SHELL_RC="$HOME/.bashrc";; esac cat >> "$SHELL_RC" <<'EOF' export ANTHROPIC_BASE_URL=https://api.teamorouter.com export ANTHROPIC_AUTH_TOKEN="your TeamoRouter API Key" export ANTHROPIC_MODEL=claude-opus-4-8 export ANTHROPIC_DEFAULT_FABLE_MODEL=claude-fable-5 export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-8 export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5 export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5 export CLAUDE_CODE_SUBAGENT_MODEL=claude-sonnet-5 export CLAUDE_CODE_EFFORT_LEVEL=xhigh EOF source "$SHELL_RC" ``` -------------------------------- ### Chat Completions with Python SDK Source: https://teamorouter.com/docs/api-integration Use the official OpenAI Python SDK to interact with TeamoRouter by setting the base_url. ```python from openai import OpenAI client = OpenAI( api_key="sk-teamo-xxxxxx", base_url="https://api.teamorouter.com/v1", ) resp = client.chat.completions.create( model="gpt-5.6-sol", messages=[{"role": "user", "content": "Hello"}], ) print(resp.choices[0].message.content) ``` -------------------------------- ### Set API Base URL Source: https://teamorouter.com/docs/open-api Configure the environment variable for the TeamoRouter API base URL. ```bash export TEAMO_BASE_URL="https://teamorouter.com" ``` -------------------------------- ### POST /v1beta/models/{model}:generateContent Source: https://teamorouter.com/docs/api-integration Generates content using a specified Gemini model. ```APIDOC ## POST /v1beta/models/{model}:generateContent ### Description Generates content based on the provided input using the specified Gemini model. ### Method POST ### Endpoint https://api.teamorouter.com/v1beta/models/{model}:generateContent ### Parameters #### Path Parameters - **model** (string) - Required - The name of the Gemini model to use (e.g., gemini-3.5-flash). #### Request Body - **contents** (array) - Required - An array of content objects containing roles and parts. ### Request Example { "contents": [ {"role": "user", "parts": [{"text": "Introduce yourself in one sentence"}]} ] } ### Response #### Success Response (200) - **candidates** (array) - The generated content candidates. - **usageMetadata** (object) - Token usage statistics. #### Response Example { "candidates": [ { "content": {"role": "model", "parts": [{"text": "I am Gemini..."}]}, "finishReason": "STOP" } ], "usageMetadata": {"promptTokenCount": 12, "candidatesTokenCount": 22, "totalTokenCount": 34} } ``` -------------------------------- ### Generate Images via REST API Source: https://teamorouter.com/docs/api-integration Uses the gpt-image-2 model to generate images from a prompt. Set a timeout of 300 seconds to accommodate longer processing times. ```bash curl https://api.teamorouter.com/v1/images/generations \ -H "Authorization: Bearer sk-teamo-xxxxxx" \ -H "content-type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "An orange cat typing on a keyboard, illustration style" }' ``` ```json { "created": 1752345600, "data": [ {"b64_json": "iVBORw0KGgo..."} ] } ``` -------------------------------- ### Set API Key Environment Variable Source: https://teamorouter.com/docs Commands to persist the TeamoRouter API key in the user environment for different operating systems. ```bash echo 'export OPENAI_API_KEY=""' >> ~/.zshrc source ~/.zshrc ``` ```bash echo 'export OPENAI_API_KEY=""' >> ~/.bashrc source ~/.bashrc ``` ```powershell [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "", "User") ``` -------------------------------- ### Streaming Request via cURL Source: https://teamorouter.com/docs/api-integration Initiates a streaming response by setting the stream parameter to true. ```bash curl https://api.teamorouter.com/v1/messages \ -H "x-api-key: sk-teamo-xxxxxx" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{ "model": "claude-fable-5", "max_tokens": 1024, "stream": true, "messages": [{"role": "user", "content": "Write a short poem"}] }' ``` -------------------------------- ### POST /v1/responses Source: https://teamorouter.com/docs/api-integration Creates a response using the OpenAI-compatible Responses API. ```APIDOC ## POST /v1/responses ### Description Generates a response for a given input using GPT models. ### Method POST ### Endpoint https://api.teamorouter.com/v1/responses ### Request Body - **model** (string) - Required - The model to use (e.g., gpt-5.6-sol) - **input** (string) - Required - The input text for the model - **stream** (boolean) - Optional - Enable streaming responses - **service_tier** (string) - Optional - Set to 'fast' or 'priority' for accelerated processing ### Response #### Success Response (200) - **output_text** (string) - The generated response text ``` -------------------------------- ### POST /v1/chat/completions Source: https://teamorouter.com/docs/api-integration Creates a chat completion request using the OpenAI-compatible format. ```APIDOC ## POST /v1/chat/completions ### Description Sends a chat completion request to the model. ### Method POST ### Endpoint https://api.teamorouter.com/v1/chat/completions ### Request Body - **model** (string) - Required - The model to use (e.g., gpt-5.6-sol) - **max_tokens** (integer) - Optional - Maximum tokens to generate - **messages** (array) - Required - List of message objects with role and content - **stream** (boolean) - Optional - Enable streaming responses - **service_tier** (string) - Optional - Set to 'fast' or 'priority' for accelerated processing ### Response #### Success Response (200) - **object** (string) - The type of object returned - **model** (string) - The model used - **choices** (array) - List of completion choices - **usage** (object) - Token usage statistics ``` -------------------------------- ### Responses API with Python SDK Source: https://teamorouter.com/docs/api-integration Use the OpenAI Python SDK to access the Responses API. ```python from openai import OpenAI client = OpenAI( api_key="sk-teamo-xxxxxx", base_url="https://api.teamorouter.com/v1", ) resp = client.responses.create( model="gpt-5.6-sol", input="Introduce TeamoRouter in one sentence", ) print(resp.output_text) ``` -------------------------------- ### POST /v1beta/models/{model}:streamGenerateContent Source: https://teamorouter.com/docs/api-integration Streams generated content using Server-Sent Events (SSE). ```APIDOC ## POST /v1beta/models/{model}:streamGenerateContent ### Description Streams content generation results using Server-Sent Events (SSE). ### Method POST ### Endpoint https://api.teamorouter.com/v1beta/models/{model}:streamGenerateContent ### Parameters #### Path Parameters - **model** (string) - Required - The name of the Gemini model to use. #### Query Parameters - **alt** (string) - Required - Must be set to 'sse' for streaming. ### Request Example { "contents": [ {"role": "user", "parts": [{"text": "Write a short poem"}]} ] } ``` -------------------------------- ### Stream Gemini content using SSE Source: https://teamorouter.com/docs/api-integration Appends the alt=sse parameter to the streamGenerateContent endpoint to enable server-sent events. ```bash curl "https://api.teamorouter.com/v1beta/models/gemini-3.5-flash:streamGenerateContent?alt=sse" \ -H "Authorization: Bearer sk-teamo-xxxxxx" \ -H "content-type: application/json" \ -d '{ "contents": [ {"role": "user", "parts": [{"text": "Write a short poem"}]} ] }' ``` -------------------------------- ### POST /v1/images/edits Source: https://teamorouter.com/docs/api-integration Edits an existing image based on provided instructions using the gpt-image-2 model. ```APIDOC ## POST /v1/images/edits ### Description Edits an existing image by uploading the source file and providing an instruction prompt. This endpoint is compatible with the OpenAI Images API. ### Method POST ### Endpoint https://api.teamorouter.com/v1/images/edits ### Request Body - **model** (string) - Required - The model to use, specifically "gpt-image-2". - **image** (file) - Required - The source image file to edit. - **prompt** (string) - Required - The instruction for editing the image. ### Request Example curl https://api.teamorouter.com/v1/images/edits \ -H "Authorization: Bearer sk-teamo-xxxxxx" \ -F model="gpt-image-2" \ -F image="@photo.png" \ -F prompt="Replace the background with a starry sky" ``` -------------------------------- ### POST /v1/images/generations Source: https://teamorouter.com/docs/api-integration Generates an image based on a provided text prompt using the gpt-image-2 model. ```APIDOC ## POST /v1/images/generations ### Description Generates an image based on a provided text prompt using the gpt-image-2 model. Note that this operation may take up to 300 seconds to complete. ### Method POST ### Endpoint https://api.teamorouter.com/v1/images/generations ### Request Body - **model** (string) - Required - The model to use, specifically "gpt-image-2". - **prompt** (string) - Required - The text description of the image to generate. ### Request Example { "model": "gpt-image-2", "prompt": "An orange cat typing on a keyboard, illustration style" } ### Response #### Success Response (200) - **created** (integer) - Timestamp of creation. - **data** (array) - List of generated image data. #### Response Example { "created": 1752345600, "data": [ {"b64_json": "iVBORw0KGgo..."} ] } ``` -------------------------------- ### Reset Gemini CLI authentication Source: https://teamorouter.com/docs/install-gemini-cli Removes the existing settings file to trigger the authentication wizard on the next command execution. ```bash rm ~/.gemini/settings.json ``` -------------------------------- ### Chat Completions Request via cURL Source: https://teamorouter.com/docs/api-integration Perform a basic chat completion request using the standard OpenAI-compatible endpoint. ```bash curl https://api.teamorouter.com/v1/chat/completions \ -H "Authorization: Bearer sk-teamo-xxxxxx" \ -H "content-type: application/json" \ -d '{ "model": "gpt-5.6-sol", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}] }' ``` -------------------------------- ### Billing Response Structure Source: https://teamorouter.com/docs/open-api JSON response format containing token usage and monetary cost for a request. ```json { "request_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": 1784081234, "model": "gpt-5.4", "usage": { "input_tokens": 1000, "output_tokens": 500, "cached_write_tokens": 800, "cached_read_tokens": 200, "total_tokens": 2500 }, "amount": { "value": "0.012680", "currency": "USD" } } ``` -------------------------------- ### Retrieve account balance endpoint Source: https://teamorouter.com/docs/open-api The endpoint to fetch the current account balance using the associated API key. ```http GET /v1/billing/balance ``` -------------------------------- ### Responses API Request via cURL Source: https://teamorouter.com/docs/api-integration Call the Responses API directly for GPT models. ```bash curl https://api.teamorouter.com/v1/responses \ -H "Authorization: Bearer sk-teamo-xxxxxx" \ -H "content-type: application/json" \ -d '{ "model": "gpt-5.6-sol", "input": "Introduce TeamoRouter in one sentence" }' ``` -------------------------------- ### Basic Message Request via cURL Source: https://teamorouter.com/docs/api-integration Sends a standard message request to the API using the Anthropic native format. ```bash curl https://api.teamorouter.com/v1/messages \ -H "x-api-key: sk-teamo-xxxxxx" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{ "model": "claude-fable-5", "max_tokens": 1024, "messages": [ {"role": "user", "content": "Introduce yourself in one sentence"} ] }' ``` -------------------------------- ### Edit Images via REST API Source: https://teamorouter.com/docs/api-integration Uploads a source image using multipart/form-data to apply edits based on a prompt. ```bash curl https://api.teamorouter.com/v1/images/edits \ -H "Authorization: Bearer sk-teamo-xxxxxx" \ -F model="gpt-image-2" \ -F image="@photo.png" \ -F prompt="Replace the background with a starry sky" ``` -------------------------------- ### Set Authentication Header Source: https://teamorouter.com/docs/open-api Include the API key in the Authorization header for all requests. ```http Authorization: Bearer sk-teamo-xxx ``` -------------------------------- ### Legacy Priority Mode Source: https://teamorouter.com/docs/api-integration The legacy service_tier value that remains supported for backward compatibility. ```json "service_tier": "priority" ``` -------------------------------- ### Retrieve billing costs endpoint Source: https://teamorouter.com/docs/open-api The endpoint for fetching aggregate billing totals. Requires start_time and end_time parameters, with a maximum range of 90 days. ```http GET /v1/billing/costs ``` -------------------------------- ### Retrieve token usage endpoint Source: https://teamorouter.com/docs/open-api The endpoint for fetching aggregate token usage. Requires start_time and end_time parameters, with a maximum range of 90 days. ```http GET /v1/usage ``` -------------------------------- ### Account balance response Source: https://teamorouter.com/docs/open-api The JSON structure returned upon a successful balance retrieval request. ```json { "balance": { "value": "85.320000", "currency": "USD" } } ``` -------------------------------- ### Chat Completions Response Structure Source: https://teamorouter.com/docs/api-integration The expected JSON response format for chat completion requests. ```json { "object": "chat.completion", "model": "gpt-5.6-sol", "choices": [ {"index": 0, "message": {"role": "assistant", "content": "Hello!"}, "finish_reason": "stop"} ], "usage": {"prompt_tokens": 214, "completion_tokens": 3, "total_tokens": 217} } ``` -------------------------------- ### Gemini API response format Source: https://teamorouter.com/docs/api-integration The expected JSON structure returned by the generateContent endpoint. ```json { "candidates": [ { "content": {"role": "model", "parts": [{"text": "I am Gemini..."}]}, "finishReason": "STOP" } ], "usageMetadata": {"promptTokenCount": 12, "candidatesTokenCount": 22, "totalTokenCount": 34} } ``` -------------------------------- ### POST /v1/messages Source: https://teamorouter.com/docs/api-integration Sends a message to the model to generate a response. Supports standard completion and streaming. ```APIDOC ## POST /v1/messages ### Description Sends a message to the specified model and receives a response. This endpoint supports both standard JSON responses and streaming via Server-Sent Events (SSE). ### Method POST ### Endpoint https://api.teamorouter.com/v1/messages ### Request Body - **model** (string) - Required - The model to use (e.g., "claude-fable-5") - **max_tokens** (integer) - Required - The maximum number of tokens to generate - **messages** (array) - Required - A list of message objects with 'role' and 'content' - **stream** (boolean) - Optional - If true, enables streaming via SSE ### Request Example { "model": "claude-fable-5", "max_tokens": 1024, "messages": [ {"role": "user", "content": "Introduce yourself in one sentence"} ] } ### Response #### Success Response (200) - **id** (string) - Unique message identifier - **type** (string) - Type of the response - **role** (string) - Role of the sender - **model** (string) - Model used - **content** (array) - List of content blocks - **stop_reason** (string) - Reason for stopping - **usage** (object) - Token usage statistics #### Response Example { "id": "msg_01KxDE...", "type": "message", "role": "assistant", "model": "claude-fable-5", "content": [{"type": "text", "text": "I am Claude..."}], "stop_reason": "end_turn", "usage": {"input_tokens": 159, "output_tokens": 34} } ``` -------------------------------- ### Retrieve Single Request Billing Source: https://teamorouter.com/docs/open-api Endpoint path for fetching billing details for a specific request ID. ```http GET /v1/billing/requests/{request_id} ``` -------------------------------- ### API error response Source: https://teamorouter.com/docs/open-api The standard JSON format for error messages returned when an API call fails. ```json { "error": { "code": "invalid_request", "message": "end_time must be greater than start_time" } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.