← Toda a documentação

Configure AskCodi API

Step-by-step guide to configure OpenAI Codex CLI with AskCodi API for enhanced AI-powered development.

Connect OpenAI Codex CLI to AskCodi API. This setup enables AI-powered development with your preferred models.

Why Connect Codex CLI to AskCodi?

Using AskCodi with Codex CLI gives you:

  • Access to multiple AI models through one interface
  • Custom model capabilities tailored to your codebase
  • Enhanced context understanding for your specific projects
  • Cost-effective AI development solutions

Setup Steps

1. Install CLI

First, install OpenAI Codex CLI:

npm install -g @openai/codex

2. Configure API

Open the config file using nano:

nano ~/.codex/config.toml

Add the AskCodi configuration:

[model_providers.askcodi]
# Name of the provider that will be displayed in the Codex UI.
name = "AskCodi"
base_url = "https://api.askcodi.com/v1"
env_key = "ASKCODI_API_KEY"
wire_api = "responses"
query_params = {}

3. Export API Key

Set your AskCodi API key as an environment variable:

export ASKCODI_API_KEY=YOUR_API_KEY_HERE

Replace YOUR_API_KEY_HERE with your actual AskCodi API key.

4. Start Codex

Launch Codex with your AskCodi configuration:

codex --config model_provider="askcodi" -- model claude-sonnet-4.5

5. Start Coding

You can now use both Chat and Agentic modes in your IDE.

Best Practices

  • Store your API key securely in environment variables
  • Regularly update the Codex CLI for the latest features
  • Test different models to find what works best for your projects
  • Monitor API usage to manage costs effectively

Troubleshooting

If you encounter issues:

  • Verify your API key is correct and exported properly
  • Check that the config.toml file is properly formatted
  • Ensure your internet connection is stable
  • Confirm that AskCodi API endpoints are accessible

Conclusion

Connecting OpenAI Codex CLI to AskCodi API streamlines your development workflow. You get access to custom models and enhanced AI capabilities for coding tasks.

Start simple. Test the connection with basic commands before using complex features.


Have you tried setting up OpenAI Codex CLI with AskCodi API? Share your experience and any tips in the comments below!

Falta algo ou está errado neste guia? Fale connosco