OpenClaw Integration
Use Ask Sage as a custom model provider for the OpenClaw AI agent platform
About OpenClaw
OpenClaw is an open-source AI agent platform that orchestrates autonomous agents with tool access, memory, and multi-channel delivery. OpenClaw supports custom model providers via Anthropic, OpenAI, and Google API formats — making it fully compatible with Ask Sage's API passthrough.
By configuring Ask Sage as a provider, your OpenClaw agents gain access to 25+ models across all major providers through a single API key — no per-model billing, no separate accounts.
Table of Contents
Prerequisites
Before you begin, ensure you have the following:
Ask Sage API Key
Generate from your Account Settings
OpenClaw Installed
Install OpenClaw on your system
Recommended Plan
AI agents consume significantly more tokens than interactive chat. Autonomous tool loops, multi-step reasoning, large context windows, and background tasks add up fast. The 5M Ultimate plan provides 5 million tokens per month — enough headroom for sustained agent workflows without running into limits mid-task.
Ask Sage uses token-based pricing — there's no per-model billing and no separate API keys for each provider. One API key gives your OpenClaw agents access to 25+ models across Anthropic, OpenAI, and Google. Switch between Claude, GPT, and Gemini freely without managing multiple accounts or worrying about per-model charges.
Configuration
Ask Sage is configured as a custom model provider in your openclaw.json configuration file under models.providers. Ask Sage supports three API formats — choose the one that matches the models you want to use.
Edit your openclaw.json (typically at ~/.openclaw/openclaw.json or in your workspace root). You can also use openclaw config edit to open it directly.
Anthropic-Style Provider (Claude Models)
Use the Anthropic Messages API format for Claude models:
{
"models": {
"providers": {
"asksage-anthropic": {
"baseUrl": "https://api.asksage.ai/server/anthropic",
"apiKey": "YOUR_ASK_SAGE_API_KEY",
"auth": "api-key",
"api": "anthropic-messages",
"models": [
{
"id": "google-claude-46-sonnet",
"name": "Google Claude 4.6 Sonnet (Ask Sage)",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 800000,
"maxTokens": 32768
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "asksage-anthropic/google-claude-46-sonnet"
}
}
}
}OpenAI-Style Provider (GPT Models)
Use the OpenAI Responses API format for GPT models:
{
"models": {
"providers": {
"asksage-openai": {
"baseUrl": "https://api.asksage.ai/server/openai/v1",
"apiKey": "YOUR_ASK_SAGE_API_KEY",
"auth": "api-key",
"api": "openai-responses",
"models": [
{
"id": "gpt-4.1",
"name": "GPT 4.1 (Ask Sage)",
"reasoning": false,
"input": ["text", "image"],
"contextWindow": 1047576,
"maxTokens": 32768
}
]
}
}
}
}Google-Style Provider (Gemini Models)
Use the Google Generative AI format for Gemini models:
{
"models": {
"providers": {
"asksage-google": {
"baseUrl": "https://api.asksage.ai/server/google/v1beta",
"apiKey": "YOUR_ASK_SAGE_API_KEY",
"auth": "api-key",
"api": "google-generative-ai",
"models": [
{
"id": "google-gemini-2.5-pro",
"name": "Gemini 2.5 Pro (Ask Sage)",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1048576,
"maxTokens": 65536
}
]
}
}
}
}Full Multi-Provider Configuration
You can configure all three providers simultaneously, giving your OpenClaw agents access to Claude, GPT, and Gemini models through a single Ask Sage API key:
{
"models": {
"providers": {
"asksage-anthropic": {
"baseUrl": "https://api.asksage.ai/server/anthropic",
"apiKey": "YOUR_ASK_SAGE_API_KEY",
"auth": "api-key",
"api": "anthropic-messages",
"models": [
{
"id": "google-claude-46-sonnet",
"name": "Google Claude 4.6 Sonnet (Ask Sage)",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 800000,
"maxTokens": 32768
},
{
"id": "google-claude-46-opus",
"name": "Claude Opus 4 (Ask Sage)",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 800000,
"maxTokens": 32768
}
]
},
"asksage-openai": {
"baseUrl": "https://api.asksage.ai/server/openai/v1",
"apiKey": "YOUR_ASK_SAGE_API_KEY",
"auth": "api-key",
"api": "openai-responses",
"models": [
{
"id": "gpt-4.1",
"name": "GPT 4.1 (Ask Sage)",
"reasoning": false,
"input": ["text", "image"],
"contextWindow": 1047576,
"maxTokens": 32768
},
{
"id": "o3-mini",
"name": "O3 Mini (Ask Sage)",
"reasoning": true,
"input": ["text"],
"contextWindow": 800000,
"maxTokens": 100000
}
]
},
"asksage-google": {
"baseUrl": "https://api.asksage.ai/server/google/v1beta",
"apiKey": "YOUR_ASK_SAGE_API_KEY",
"auth": "api-key",
"api": "google-generative-ai",
"models": [
{
"id": "google-gemini-2.5-pro",
"name": "Gemini 2.5 Pro (Ask Sage)",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1048576,
"maxTokens": 65536
},
{
"id": "google-gemini-2.5-flash",
"name": "Gemini 2.5 Flash (Ask Sage)",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1048576,
"maxTokens": 65536
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "asksage-anthropic/google-claude-46-sonnet"
}
}
}
}Change the agents.defaults.model.primary value to switch your default agent model. For example, set it to asksage-openai/gpt-4.1 or asksage-google/google-gemini-2.5-pro to use a different provider as your default.
Available Models
Below are key models available through Ask Sage, organized by provider API format. Use the Model ID value in your openclaw.json configuration.
Anthropic Models (anthropic-messages)
| Model ID | Name | Context Window | Max Tokens | Reasoning |
|---|---|---|---|---|
google-claude-46-opus | Claude 4.6 Opus (via GCP) | 800K | 32,768 | |
google-claude-46-sonnet | Claude 4.6 Sonnet (via GCP) | 800K | 32,768 | |
google-claude-45-opus | Claude 4.5 Opus (via GCP) | 135K | 32,768 | |
google-claude-45-sonnet | Claude 4.5 Sonnet (via GCP) | 135K | 32,768 | |
google-claude-45-haiku | Claude 4.5 Haiku (via GCP) | 135K | 32,768 | |
google-claude-4-opus | Claude 4 Opus (via GCP) | 167K | 32,768 | |
google-claude-4-sonnet | Claude 4 Sonnet (via GCP) | 135K | 32,768 |
OpenAI Models (openai-responses)
| Model ID | Name | Context Window | Max Tokens | Reasoning |
|---|---|---|---|---|
gpt-o4-mini | GPT o4 Mini | 120K | 100,000 | |
gpt-o3 | GPT o3 | 120K | 100,000 | |
gpt-o3-mini | GPT o3 Mini | 120K | 65,536 | |
gpt-o1 | GPT o1 | 100K | 32,768 | |
gpt-5.4 | GPT 5.4 | 170K | 32,768 | |
gpt-5.4-nano | GPT 5.4 Nano | 170K | 32,768 | |
gpt-5.2 | GPT 5.2 | 170K | 32,768 | |
gpt-5.1 | GPT 5.1 | 170K | 32,768 | |
gpt-5 | GPT 5 | 170K | 32,768 | |
gpt-5-mini | GPT 5 Mini | 170K | 32,768 | |
gpt-5-nano | GPT 5 Nano | 170K | 32,768 | |
gpt-4.1 | GPT 4.1 | 1,047K | 32,768 | |
gpt-4.1-mini | GPT 4.1 Mini | 1,047K | 32,768 | |
gpt-4.1-nano | GPT 4.1 Nano | 1,047K | 32,768 |
Google Models (google-generative-ai)
| Model ID | Name | Context Window | Max Tokens | Reasoning |
|---|---|---|---|---|
google-gemini-2.5-pro | Gemini 2.5 Pro | 924K | 65,536 | |
google-gemini-2.5-flash | Gemini 2.5 Flash | 924K | 65,536 | |
google-gemini-2.5-flash-image | Gemini 2.5 Flash (Image) | 32K | 65,536 | |
google-imagen-4 | Imagen 4 (Image Generation) | — | — | |
google-veo-3-fast | Veo 3 Fast (Video Generation) | — | — |
Government & DoD Models
Ask Sage provides access to government-authorized models that meet FedRAMP High and DoD IL5/IL6 compliance requirements. These models use dedicated government endpoints and are suitable for CUI and classified workloads.
Government Model IDs
| Model ID | Description | Provider |
|---|---|---|
gpt-4.1-gov | GPT 4.1 (Azure Government) | OpenAI |
gpt-o3-mini-gov | O3 Mini (Azure Government) | OpenAI |
aws-bedrock-claude-45-sonnet-gov | Claude Sonnet 4.5 (AWS GovCloud) | Anthropic |
aws-bedrock-claude-37-sonnet-gov | Claude Sonnet 3.7 (AWS GovCloud) | Anthropic |
aws-bedrock-claude-35-haiku-gov | Claude Haiku 3.5 (AWS GovCloud) | Anthropic |
Government models require a government tenant Ask Sage account and use government-specific base URLs (e.g., https://api.genai.army.mil/server/openai/v1). The base URL will be displayed when you generate your API key. Contact your organization's Ask Sage administrator for access.
Verification
After configuring your openclaw.json, verify the provider is registered and working:
Check Provider Status
Run the following command to confirm OpenClaw recognizes your Ask Sage provider:
openclaw statusYou should see your Ask Sage providers listed under the registered model providers section.
Test a Conversation
Start an interactive session to confirm the model responds correctly:
# Start OpenClaw and send a test message
openclaw startIf the agent responds, your Ask Sage integration is working correctly.
Troubleshooting
Solutions:
- Verify your API key is correct — copy it again from your Account Settings
- Check that the
apiKeyfield inopenclaw.jsonhas no extra spaces or line breaks - Ensure your Ask Sage subscription is active and includes API access
Solutions:
- Verify the
idin your model definition matches a valid Ask Sage model ID - Check that you're using the correct API format for the model (e.g., Claude models use
anthropic-messages, notopenai-responses) - Government models require a government tenant — commercial API keys cannot access
-govmodels
Solutions:
- Check your network connectivity to
api.asksage.ai - Verify no firewall rules are blocking outbound HTTPS connections
- Reasoning models (e.g.,
google-claude-46-sonnetwith extended thinking) may take longer — increase timeout values in OpenClaw's configuration if needed
openclaw status Solutions:
- Validate your
openclaw.jsonis valid JSON (usejq . openclaw.jsonto check) - Ensure the provider is under
models.providers, not at the root level - Restart the OpenClaw gateway after configuration changes:
openclaw gateway restart
Additional Resources
- OpenClaw Documentation
- Ask Sage Platform
- Ask Sage OpenAI API Compatibility Guide
- Codex Integration — Another tool compatible with Ask Sage
- Claude Code Integration — Another tool compatible with Ask Sage