<aside>

Overview

:ambient-logo-original: Docs Home

What is Ambient?

Getting Started

Testnet

App

API

On-Chain

Tool Oracle

Claude Code

Miners

Encyclopedia

Solana Quickstart

Developers

OpenAI SDK

Anthropic SDK

API Docs

API Playground

Links

🌐 Homepage

✉️ [email protected]

:discord-symbol-blurple: Discord

:github-mark-white-bg: github.com/ambient-xyz

:x-logo-black: @ambient_xyz

:x-logo-black: @IridiumEagle

</aside>

This guide shows how to configure Claude Code to use Ambient's inference API.

Prerequisites

  1. An Ambient account with credits
  2. An Ambient API key from app.ambient.xyz/keys
  3. Claude Code installed (npm install -g @anthropic-ai/claude-code)

Configuration

Set the following environment variables:

export ANTHROPIC_BASE_URL=https://api.ambient.xyz
export ANTHROPIC_API_KEY=your-ambient-api-key

Or add them to your shell profile (~/.bashrc, ~/.zshrc, etc.).

Usage

Once configured, run Claude Code as normal:

claude

Claude Code will automatically route requests through Ambient's inference API.

Verifying the Configuration

You can verify your setup by running:

echo $ANTHROPIC_BASE_URL  # Should show: <https://api.ambient.xyz>
echo $ANTHROPIC_API_KEY   # Should show your Ambient API key

Resources