mirror of
https://github.com/Gitlawb/openclaude.git
synced 2026-08-24 10:14:19 -05:00
* 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>
2.2 KiB
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
- An AI/ML API account and API key from https://aimlapi.com (Dashboard → API Keys).
Option 1 — Interactive (/provider)
- Start OpenClaude and run
/provider. - Choose AI/ML API.
- 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
/statusshows AI/ML API as the active provider with thehttps://api.aimlapi.com/v1base URL./modellists 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 /modelsendpoint 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 theHTTP-Referer: OpenClaudeandX-Title: OpenClaudeheaders that AI/ML API uses to attribute integration traffic. - Usage (
/usage) reporting is not supported for this provider.