For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

1

Install OpenClaude

Requires Node.js >=22.

npm install -g @gitlawb/openclaude@latest
2

Open the provider picker

Start OpenClaude and run:

/provider
3

Choose aimlapi.com

Pick aimlapi.com, then either paste an existing key or let OpenClaude create an account and issue one.

4

Start chatting

The base URL is filled in automatically. Pick your model with /model.

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:

The base URL is:

Need a key first? Use API Key Management.

Set up AI/ML API in OpenClaude

Option 1 — Interactive (/provider)

  1. Start OpenClaude and run /provider.

  2. Choose aimlapi.com.

  3. 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 default

  • anthropic/claude-sonnet-5 — coding and long-form work

  • google/gemini-3-7-flash — lower latency and lower cost

For the full catalog, use All Model IDs.

Verify

  • /status shows AI/ML API as the active provider with the https://api.aimlapi.com/v1 base URL.

  • /model lists 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_KEY

  • base URL: https://api.aimlapi.com/v1 (built in, no manual config needed)

  • model ID: exact AI/ML API chat model ID

Troubleshooting

aimlapi.com is not in the /provider list

Update to the latest version — the preset ships upstream:

I get an auth error

Check that:

Checkout completed but the key was not saved

The key exchange is one-shot and cannot be retried. If the local receipt could not be written (for example a read-only config directory), OpenClaude stops and names the issued key ID. Open aimlapi.com/app, rotate that key, and configure the new one manually.

/usage shows nothing

Usage reporting is not supported for this provider. Track spend at aimlapi.com/app instead.

Last updated

Was this helpful?