Files
openclaude/docs/aimlapi-setup.md
T
8369f2018e feat(provider): add AI/ML API provider (#863)
* feat(provider): add AI/ML API integration

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(provider): preserve bootstrap model fallback

* fix(provider): complete aimlapi env-only routing

* test(provider): keep first-run preset assertions visible

* fix(provider): align aimlapi attribution and setup docs

* fix(provider): use aimlapi rebate attribution headers

* fix(provider): report current integration version

* fix(provider): prioritize dedicated aimlapi credentials

* fix(provider): complete AI/ML API attribution headers

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Lookoff123 <bataryshkinairina@gmail.com>
2026-07-07 11:08:50 +08:00

2.2 KiB

AI/ML API Setup

OpenClaude connects to AI/ML API through its OpenAI-compatible endpoint at https://api.aimlapi.com/v1.

Overview

AI/ML API is an aggregating gateway that exposes many chat models behind a single OpenAI-compatible API. OpenClaude ships a first-class AI/ML API provider preset: it stores credentials under AIMLAPI_API_KEY, sends the OpenClaude attribution headers, and discovers chat-capable models from the public /models catalog. It defaults to gpt-4o.

Prerequisites

Option 1 — Interactive (/provider)

  1. Start OpenClaude and run /provider.
  2. Choose AI/ML API.
  3. Paste your API key when prompted. The base URL (https://api.aimlapi.com/v1) and default model (gpt-4o) are filled in automatically.

Switch models any time with /model — only chat-capable models from the AI/ML API catalog are listed.

Option 2 — Environment variables

Setting AIMLAPI_API_KEY alone is enough; OpenClaude auto-detects the AI/ML API route:

export AIMLAPI_API_KEY="your-aimlapi-key"

To configure the OpenAI-compatible route explicitly:

export CLAUDE_CODE_USE_OPENAI=1
export AIMLAPI_API_KEY="your-aimlapi-key"
export OPENAI_BASE_URL="https://api.aimlapi.com/v1"
export OPENAI_MODEL="gpt-4o"

OPENAI_API_KEY also works as a fallback credential for the route.

Verify

  • /status shows AI/ML API as the active provider with the https://api.aimlapi.com/v1 base URL.
  • /model lists chat-capable models discovered from the catalog.
  • Send any prompt to confirm responses come back from the selected model.

Notes

  • Model discovery uses the public, unauthenticated GET /models endpoint and surfaces only chat-completions models; image, audio, embeddings, and other modalities are intentionally not routed through the coding workflow.
  • Requests carry X-AIMLAPI-Integration-* attribution headers (owner/repo/version) plus the HTTP-Referer: OpenClaude and X-Title: OpenClaude headers that AI/ML API uses to attribute integration traffic.
  • Usage (/usage) reporting is not supported for this provider.