OpenClaude
Connect OpenClaude, the open-source coding-agent CLI, to AI/ML API through its built-in provider preset.
About
OpenClaude is an open-source coding-agent CLI that works with many model providers. Its homepage is openclaude.gitlawb.com.
AI/ML API is a built-in provider preset in OpenClaude — it ships upstream, so a plain install already has it. OpenClaude can also create an AI/ML API account for you, top it up, and save the issued key, so you can start with no key at all.
Quick start
When to use AI/ML API with OpenClaude
AI/ML API works well with OpenClaude when you want:
one key for many model providers behind a single OpenAI-compatible endpoint
a model picker populated live from the AI/ML API catalog
to onboard from the terminal, without opening a dashboard first
Prerequisites
Before you start, make sure you have:
Node.js
>=22and OpenClaude installedan AI/ML API key from aimlapi.com/app/keys — optional, the guided flow can issue one
a model ID from aimlapi.com/models
The base URL is:
Need a key first? Use API Key Management.
Set up AI/ML API in OpenClaude
Option 1 — Interactive (/provider)
Start OpenClaude and run
/provider.Choose aimlapi.com.
Choose how to get a key:
I am a new user — enter your email. OpenClaude creates a passwordless account, lets you pick a top-up amount, opens card checkout, then saves the issued key.
I already have aimlapi.com key — paste a key from the dashboard. OpenClaude validates it, checks the balance, and offers a top-up when the balance is low.
If AI/ML API is already configured, the same menu offers Continue with your saved API key instead.
Option 2 — CLI top-up
Run the guided flow non-interactively:
--amount— top-up amount in USD (min 20, max 10000; defaults to 25)--model— default model ID written into the provider profile--no-open— print the payment URL instead of opening a browser
An existing account also needs the 6-digit code emailed to you. Interactive terminals prompt for it; for scripts, pipe it in with --code-stdin.
Option 3 — Environment variables
Setting the key alone is enough — OpenClaude auto-detects the AI/ML API route:
To configure the OpenAI-compatible route explicitly:
Model selection
/model lists chat-capable models discovered from the AI/ML API catalog. Image, audio, and embedding models are intentionally not offered in the coding workflow.
Model IDs carry a vendor prefix (openai/gpt-4o, not gpt-4o). Pick the model from /model after setup rather than relying on the preset's built-in default.
Good starting models
openai/gpt-4o— broadly capable, good defaultanthropic/claude-sonnet-5— coding and long-form workgoogle/gemini-3-7-flash— lower latency and lower cost
For the full catalog, use All Model IDs.
Verify
/statusshows AI/ML API as the active provider with thehttps://api.aimlapi.com/v1base URL./modellists chat-capable models from the catalog.Send any prompt to confirm responses come back from the selected model.
Config checklist
Make sure these values are set:
API key variable:
AIMLAPI_API_KEYbase URL:
https://api.aimlapi.com/v1(built in, no manual config needed)model ID: exact AI/ML API chat model ID
Troubleshooting
Links
All Model IDs
Last updated
Was this helpful?