For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs. Agents can also search and read this documentation through its MCP server.
Skip to content

Zero

Connect Zero, the terminal coding agent, to AI/ML API through its built-in provider preset.

About

Zero is an AI coding agent for your local terminal. It inspects a repository, edits files, and runs commands, either through its TUI or non-interactively with zero exec for scripts and CI.

AI/ML API is a built-in, recommended provider preset in Zero — it ships upstream, so there is nothing to patch or build from source. Zero also offers guided onboarding: you can create an AI/ML API account, top it up, and get a key without leaving the terminal.

Prefer one command? npx aimlapi zero signs you in through the browser and starts zero already connected to AI/ML API, with no key to copy. It uses its own aimlapi-cli provider profile instead of the built-in preset. See CLI.

If you use aimlapi zero, don't export AIMLAPI_API_KEY as described below: it overrides the key from aimlapi login for every aimlapi command. After aimlapi zero --config, a plain zero reads the key from AIMLAPI_CLI_KEY, so add the line the CLI prints to your shell profile (this needs an installed aimlapi: npm i -g aimlapi or the install script, not npx): export AIMLAPI_CLI_KEY="$(aimlapi key print)".

Quick start

1

Install Zero

npm install -g @gitlawb/zero
2

Set your API key

export AIMLAPI_API_KEY=your_key_here

You can skip this step and let Zero's onboarding create an account and issue a key for you.

3

Select AI/ML API

zero providers setup aimlapi --set-active
4

Start Zero

zero

When to use AI/ML API with Zero

AI/ML API works well with Zero when you want:

  • one key and one base URL for many model providers

  • to switch models without re-configuring the agent

  • 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 Zero

Option 1 — Provider setup command

The preset fills in the base URL and default model. --set-active makes AI/ML API the provider Zero uses for the next session.

Option 2 — Setup wizard

Run zero and follow the setup wizard, or run it directly:

AI/ML API is listed as aimlapi.com and sorts to the top of the picker as a recommended provider.

Option 3 — Environment variable

Export the key before running setup and Zero picks it up automatically:

Guided onboarding

If you have no key yet, the onboarding flow in the TUI takes an email, creates an AI/ML API account, lets you choose a top-up amount, opens checkout in the browser, and saves the issued key into your Zero provider profile.

Model selection

Use exact AI/ML API model IDs. List what is available:

Good starting models

  • anthropic/claude-sonnet-5 — the preset default, strong for coding

  • openai/gpt-5-5 — strong general use

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

For the full catalog, use All Model IDs.

Config checklist

Make sure these values are set:

  • API key variable: AIMLAPI_API_KEY

  • provider ID: aimlapi (shown as aimlapi.com)

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

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

Troubleshooting

Zero does not pick up AIMLAPI_API_KEY

Check that the variable is exported in the current shell:

Then confirm what Zero resolved:

aimlapi.com is not in the provider list

Update Zero to the latest version — the preset ships upstream:

I get an auth error

Check that:

I want to point Zero at a different endpoint

AIMLAPI_INFERENCE_URL overrides the inference base URL. Leave it unset to use the default https://api.aimlapi.com/v1.

Last updated

Was this helpful?