AkashML

Documentation

Introduction
Claude Code
List models (Anthropic shape) GETAnthropic base health probe GETCreate a message (Anthropic shape) POST
Anthropic SDK
List models GET
Create chat completion POSTCreate completion POST
Platform
Parameter controlsPresetsInferences
Models
Settings
Guides

Claude Code

Claude Code is Anthropic's CLI for AI-assisted coding. AkashML serves an Anthropic-compatible Messages endpoint at https://api.akashml.com/anthropic, so you can point Claude Code at AkashML by setting a few environment variables. This guide covers manual configuration on macOS, Linux, and Windows.

Prerequisites

  • An AkashML account and an API key. Create one under Settings → API Keys.

Step 1 — Install Claude Code

The recommended method is the native installer, which auto-updates in the background. For alternative methods (Homebrew, npm, WinGet), see the official install guide.

macOS / Linux / WSL:

curl -fsSL https://claude.ai/install.sh | bash

Windows (PowerShell):

irm https://claude.ai/install.ps1 | iex

Verify the install:

claude --version

Step 2 — Configure AkashML

On macOS and Linux, Claude Code reads environment variables from ~/.claude/settings.json — create the file if it doesn't exist and paste the JSON snippet below. On Windows, set the variables directly with PowerShell or Command Prompt as shown further down.

macOS and Linux

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.akashml.com/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "akml-...",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-ai/DeepSeek-V4-Flash",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "moonshotai/Kimi-K2.6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "Qwen/Qwen3.5-35B-A3B",
    "API_TIMEOUT_MS": "3000000"
  }
}

Replace akml-... with your real API key.

Windows (PowerShell)

Run each line in PowerShell, then open a new PowerShell window so the variables are picked up.

PowerShell
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.akashml.com/anthropic", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "akml-...", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_DEFAULT_SONNET_MODEL", "deepseek-ai/DeepSeek-V4-Flash", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_DEFAULT_OPUS_MODEL", "moonshotai/Kimi-K2.6", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_DEFAULT_HAIKU_MODEL", "Qwen/Qwen3.5-35B-A3B", "User")
[System.Environment]::SetEnvironmentVariable("API_TIMEOUT_MS", "3000000", "User")

Windows (Command Prompt)

Command Prompt
setx ANTHROPIC_BASE_URL "https://api.akashml.com/anthropic"
setx ANTHROPIC_AUTH_TOKEN "akml-..."
setx ANTHROPIC_DEFAULT_SONNET_MODEL "deepseek-ai/DeepSeek-V4-Flash"
setx ANTHROPIC_DEFAULT_OPUS_MODEL "moonshotai/Kimi-K2.6"
setx ANTHROPIC_DEFAULT_HAIKU_MODEL "Qwen/Qwen3.5-35B-A3B"
setx API_TIMEOUT_MS "3000000"

Open a new Command Prompt window so the variables are picked up.

Environment variables

VariableRequiredValue
ANTHROPIC_BASE_URLyeshttps://api.akashml.com/anthropic
ANTHROPIC_AUTH_TOKENyesYour AkashML API key (akml-...)
ANTHROPIC_DEFAULT_SONNET_MODELnoModel to use when Claude Code requests Sonnet
ANTHROPIC_DEFAULT_OPUS_MODELnoModel to use when Claude Code requests Opus
ANTHROPIC_DEFAULT_HAIKU_MODELnoModel to use when Claude Code requests Haiku
API_TIMEOUT_MSnoRequest timeout in milliseconds. Raise it for long agent runs.

Step 3 — Start Claude Code

Open a new terminal window so the configuration is picked up, then run claude from any project directory:

claude

Send a prompt — for example, "Summarize this repository" — to confirm Claude Code is connected. Requests count against your AkashML credit balance and show up in the Dashboard usage chart.

Model mapping

Claude Code internally chooses between Haiku, Sonnet, and Opus depending on the task: a small lookup might use Haiku, an edit might use Sonnet, deep reasoning might use Opus. The three ANTHROPIC_DEFAULT_*_MODEL variables route each tier to an appropriate AkashML model:

  • Sonnet → deepseek-ai/DeepSeek-V4-Flash — fast general-purpose coding model.
  • Opus → moonshotai/Kimi-K2.6 — larger reasoning-focused model for harder tasks.
  • Haiku → Qwen/Qwen3.5-35B-A3B — lightweight model for quick lookups.

Override per session with claude --model <model-id>, or change the defaults in ~/.claude/settings.json.

FAQ

Which AkashML model does each Anthropic alias map to?

See the Model mapping section above. The defaults are suggestions — adjust them to your preference.

Can I use a different AkashML model?

Yes. Override for a single session with claude --model <model-id>, or change the ANTHROPIC_DEFAULT_*_MODEL values in ~/.claude/settings.json.

Why is API_TIMEOUT_MS so high?

Long agent runs — multi-step tool use, large file edits — can take a while. 3000000 ms (about 50 minutes) gives Claude Code plenty of headroom. Lower it if you prefer faster failures.

Where do I get an AkashML API key?

Create one under Settings → API Keys in the dashboard. Keys you create there work directly with Claude Code via ANTHROPIC_AUTH_TOKEN.

How is usage billed?

The same way as any AkashML API call: tokens are charged against your credit balance. Watch real-time consumption on the Dashboard usage chart.

Introduction

Get started with AkashML — open source AI model inference powered by Akash Network.

List models (Anthropic shape) GET

Lists available models in the Anthropic API shape. Model IDs containing `/` are aliased with `--` (e.g., `anthropic/claude-3-5-sonnet` → `anthropic--claude-3-5-sonnet`) because Claude Code rejects slashed identifiers.

On this page

Claude CodePrerequisitesStep 1 — Install Claude CodeStep 2 — Configure AkashMLmacOS and LinuxWindows (PowerShell)Windows (Command Prompt)Environment variablesStep 3 — Start Claude CodeModel mappingFAQWhich AkashML model does each Anthropic alias map to?Can I use a different AkashML model?Why is API_TIMEOUT_MS so high?Where do I get an AkashML API key?How is usage billed?