← Toda a documentação

Configuring AskCodi API

Step-by-step guide to powering OpenClaw with AskCodi API. Access GPT-5.3-codex, Claude Opus 4.6, and Gemini models for your autonomous AI agent. Installation & config included.

Why AskCodi + OpenClaw?

OpenClaw is a powerful open-source AI agent that runs 24/7 on your machine, but it needs an AI provider to power its intelligence. AskCodi is the perfect match for OpenClaw, offering:

  1. Access to Multiple Models: Choose from GPT-5, Claude 4, Gemini 3, DeepSeek, and dozens of other cutting-edge models
  2. Cost-Effective: Competitive pricing for developer-centric paid models
  3. OpenAI-Compatible API: Seamless integration with OpenClaw's OpenAI-compatible interface
  4. Developer-Focused: Built specifically for coding tasks with optimized performance
  5. High Context Windows: Access models with up to 200K+ token context windows
  6. Paid Models Only: OpenClaw requires the advanced capabilities of AskCodi's paid models for agentic execution. Free models are not supported for this integration.

Prerequisites

Before you begin, make sure you have:

  1. OpenClaw installed - If not, run: curl -fsSL https://openclaw.ai/install.sh | bash
  2. AskCodi API Key - Sign up at askcodi.com and generate an API key from your dashboard

Setup Guide

Step 1: Install OpenClaw

If you haven't already installed OpenClaw, run:

curl -fsSL https://openclaw.ai/install.sh | bash

This will install OpenClaw and create the necessary configuration directories.

Step 2: Configure AskCodi as Your Provider

Open your OpenClaw configuration file:

nano ~/.openclaw/openclaw.json

Add the AskCodi provider configuration. Here's an example with multiple models:

{
  "models": {
    "providers": {
      "askcodi": {
        "baseUrl": "https://api.askcodi.com/v1",
        "apiKey": "YOUR_ASKCODI_API_KEY",
        "api": "openai-completions",
        "models": [
          {
            "id": "openai/gpt-5.3-codex",
            "name": "gpt-5.3-codex",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 128000,
            "maxTokens": 16384
          },
          {
            "id": "anthropic/claude-opus-4-6",
            "name": "claude-opus-4-6",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 200000,
            "maxTokens": 8192
          },
          {
            "id": "google/gemini-3-pro",
            "name": "gemini-3-pro",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 1000000,
            "maxTokens": 8192
          },
          {
            "id": "deepseek/deepseek-v3.2",
            "name": "deepseek-v3.2",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 64000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "askcodi/deepseek/deepseek-v3.2"
      },
      "models": {
        "askcodi/anthropic/claude-opus-4-6": {},
        "askcodi/openai/gpt-5.3-codex": {},
        "askcodi/google/gemini-3-pro": {},
        "askcodi/deepseek/deepseek-v3.2": {}
      }
    }
  }
}

Important Notes:

  • Replace YOUR_ASKCODI_API_KEY with your actual API key
  • The example shows 4 popular models, but AskCodi supports 50+ models
  • You can add or remove models based on your needs
  • Cost values are in USD per million tokens (adjust based on current AskCodi pricing)
  • Set your preferred model as the primary model in the agents.defaults section

Step 3: Run the Onboarding Wizard

Start the OpenClaw onboarding process:

openclaw onboard --install-daemon

During the wizard, you'll be prompted with several options:

  1. Model/auth provider: Skip for now (we've already configured it in the JSON file)
  2. Filter models by provider: Select askcodi
  3. Model/select models: Choose your preferred model(s) from the list

The wizard will:

  • Install the OpenClaw daemon for 24/7 operation
  • Set up your messaging platform integration (Telegram, Discord, Slack, etc.)
  • Configure your default model preferences

Step 4: Choose Your Messaging Platform

OpenClaw works with multiple messaging platforms. Here are the most popular options:

Option A: Telegram (Recommended for Mobile)

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow the prompts to create your bot
  3. Copy the bot token
  4. Add the token to your OpenClaw configuration
  5. Start chatting with your bot!

Option B: Discord

  1. Create a Discord application at discord.com/developers
  2. Create a bot and copy the token
  3. Add the token to OpenClaw configuration
  4. Invite the bot to your server

Option C: Slack

  1. Create a Slack app at api.slack.com/apps
  2. Configure bot permissions
  3. Install to your workspace
  4. Add credentials to OpenClaw

Step 5: Start Using OpenClaw

That's it! Your OpenClaw instance is now powered by AskCodi's API. You can:

  • Message your AI assistant through your configured platform
  • Switch between models on the fly
  • Install skills to extend capabilities
  • Run 24/7 automation tasks

Available Models on AskCodi

AskCodi provides access to 50+ AI models. Here are some popular options for OpenClaw:

Premium Models

  • GPT-5.3 Codex - OpenAI's most capable coding model
  • Claude Opus 4.6 - Anthropic's state-of-the-art reasoning model
  • Gemini 3 Pro - Google's latest multimodal powerhouse
  • DeepSeek V3.2 - Advanced reasoning and coding capabilities

Cost-Effective Models

  • DeepSeek V3.2 - Industry leading price-to-performance
  • Gemini 3 Flash - Ultra-fast and affordable
  • GPT-5 Mini - High efficiency at low cost
  • Grok Code Fast - Optimized for rapid code generation

Specialized Models

  • Claude Sonnet 4.5 - Perfect balance of speed and intelligence
  • Kimi K2.5 - Advanced reasoning model
  • MiniMax M2.1 - Strong performance for creative tasks
  • GLM 4.7 - Excellent multilingual capabilities

To see the full list of available models, visit the AskCodi Models page or check your AskCodi dashboard.

Switching Between Models

One of the benefits of using AskCodi with OpenClaw is the ability to switch models easily:

Method 1: Update Configuration

Edit ~/.openclaw/openclaw.json and change the primary model:

"agents": {
  "defaults": {
    "model": {
      "primary": "askcodi/openai/gpt-5.3-codex"
    }
  }
}

Then restart OpenClaw: openclaw restart

Method 2: Use Model-Specific Commands

Some OpenClaw skills allow you to specify models per-task. Check the skills documentation for details.

Method 3: Create Multiple Agents

Configure different agents with different default models for specialized tasks:

"agents": {
  "defaults": {
    "model": {
      "primary": "askcodi/anthropic/claude-opus-4-6"
    }
  },
  "code-review": {
    "model": {
      "primary": "askcodi/openai/gpt-5.3-codex"
    }
  },
  "quick-tasks": {
    "model": {
      "primary": "askcodi/google/gemini-3-flash"
    }
  }
}

Advanced Configuration

Cost Optimization

To minimize costs while maintaining quality:

  1. Use tiered models: Fast models for simple tasks, premium models for complex reasoning
  2. Enable caching: Models like Claude support prompt caching to reduce costs
  3. Set token limits: Configure maxTokens to prevent runaway costs
  4. Monitor usage: Check your AskCodi dashboard regularly

Performance Tuning

For optimal performance:

  1. Choose models with appropriate context windows: Larger codebases need larger contexts
  2. Enable reasoning for complex tasks: Set "reasoning": true for models that support it
  3. Configure timeouts: Adjust request timeouts based on your use case

Security Best Practices

  1. Environment Variables: Store your API key in an environment variable instead of the config file:

    export ASKCODI_API_KEY="your-api-key"
    

    Then reference it in the config: "api_key": "$ASKCODI_API_KEY"

  2. Restrict File Access: Limit OpenClaw's access to specific directories

  3. Use VPS Security: If running on a VPS, configure firewalls and SSH properly

  4. Rotate Keys: Regularly rotate your AskCodi API keys

  5. Audit Logs: Review OpenClaw's activity logs for unexpected behavior

Troubleshooting

Common Issues

Issue: OpenClaw can't find the AskCodi API key

  • Solution: Verify the key is correctly set in ~/.openclaw/openclaw.json
  • Check for typos or extra spaces

Issue: Models not appearing in the selection menu

  • Solution: Ensure the models array is properly formatted in the config
  • Run openclaw onboard again to refresh

Issue: API rate limits or errors

  • Solution: Check your AskCodi dashboard for usage limits
  • Consider upgrading your plan or switching to a different model

Issue: Slow response times

  • Solution: Try a faster model like Gemini Flash or GPT-4o Mini
  • Check your network connection

Next Steps

Now that you have OpenClaw set up with AskCodi:

  1. Install Skills: Browse the OpenClaw Skills Directory and add capabilities
  2. Explore Models: Try different models from AskCodi to find your favorites
  3. Automate Workflows: Set up recurring tasks and automations
  4. Join the Community: Connect with other OpenClaw users at clawhub.ai

Resources


Conclusion

The combination of OpenClaw's autonomous capabilities and AskCodi's extensive model selection creates a truly powerful development assistant. With access to 50+ models, you can choose the perfect balance of cost, speed, and capability for each task.

Whether you need GPT-5.3's coding prowess, Claude Opus's deep reasoning, or Gemini Flash's speed for quick tasks, AskCodi gives you the flexibility to use the right tool for the job—all through a single, consistent OpenClaw interface.

Ready to supercharge your development workflow? Get your AskCodi API key today and start building with OpenClaw!

Falta algo ou está errado neste guia? Fale connosco