---
title: Claude Code | RunAPI
description: Install Claude Code, connect it to RunAPI, choose a model, and verify
  the configuration.
url: https://runapi.ai/docs/resources/tool-integrations/claude-code.md
canonical: https://runapi.ai/docs/resources/tool-integrations/claude-code
locale: en
---

> HTML version: https://runapi.ai/docs/resources/tool-integrations/claude-code
> Site index for agents: https://runapi.ai/llms.txt

# Claude Code

## Overview

Claude Code is an agentic coding tool for the terminal. This guide
installs the CLI, points its Anthropic-compatible requests at RunAPI,
selects a RunAPI model, and verifies the connection.

## Before you begin

* Use a platform supported by the [official Claude Code setup guide][1].
* Create a standard RunAPI API key in the [Authentication
  Guide](https://runapi.ai/docs/guides/authentication.md). Do not commit it to a repository.
* Copy a model identifier that supports Anthropic Messages from the
  [Model Catalog](https://runapi.ai/models).



[1]: https://code.claude.com/docs/en/setup

## Install

Use the official native installer on macOS, Linux, or WSL, then confirm
the command is available:

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

For Homebrew, WinGet, and platform-specific requirements, use the
[official installation guide][1].



[1]: https://code.claude.com/docs/en/setup

## Configure RunAPI

For a first test, export the Base URL, API key, and model in the current
shell:

```shell
export ANTHROPIC_BASE_URL=https://runapi.ai
export ANTHROPIC_API_KEY=YOUR_RUNAPI_API_KEY
export ANTHROPIC_MODEL=YOUR_RUNAPI_MODEL_ID
```

To apply the values to every Claude Code session for your user, put them
in the `env` object in `~/.claude/settings.json`:

```json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://runapi.ai",
    "ANTHROPIC_API_KEY": "YOUR_RUNAPI_API_KEY",
    "ANTHROPIC_MODEL": "YOUR_RUNAPI_MODEL_ID"
  }
}
```

Keep the real key out of `.claude/settings.json`, which is intended for
project settings that may be committed. For configuration scopes and
precedence, use the [Claude Code settings reference][1].



[1]: https://code.claude.com/docs/en/settings

## Choose a model

Replace `YOUR_RUNAPI_MODEL_ID` with the exact identifier from the [Model
Catalog](https://runapi.ai/models). `ANTHROPIC_BASE_URL` changes where requests are sent;
it does not choose a model. You can also start one session with `claude
--model YOUR_RUNAPI_MODEL_ID` or run `/model` during a session.

## Verify

Run the installation and configuration checks, then send one short
prompt:

```shell
claude --version
claude doctor
claude
```

Inside Claude Code, run `/status` to confirm the loaded settings and
active model. A normal response to `Describe this repository in one
sentence.` confirms that the RunAPI connection works.

## Troubleshoot

* **`claude` is not found:** reopen the terminal and follow the
  [official install troubleshooting][1].
* **Settings do not load:** validate `~/.claude/settings.json` with
  `claude doctor`, then use `/status` to inspect the loaded sources.
* **Authentication fails:** confirm `ANTHROPIC_API_KEY` contains an
  active RunAPI key. Create or rotate keys through the [Authentication
  Guide](https://runapi.ai/docs/guides/authentication.md).
* **The model is unavailable:** copy the exact identifier from the
  [Model Catalog](https://runapi.ai/models), then start a new session. Resumed sessions
  may retain their previous model.
* **Requests use another endpoint:** start a fresh terminal after
  changing environment variables and check for a higher-precedence
  Claude Code setting.



[1]: https://code.claude.com/docs/en/troubleshoot-install

## Next steps

Use the [LLM API quickstart](https://runapi.ai/docs/guides/llm-api/quickstart.md) for
protocol behavior and the [Anthropic Messages API
Reference](https://runapi.ai/docs/api/anthropic/messages.md) for request fields. To add
RunAPI tools to Claude Code, continue with the [MCP
Overview](https://runapi.ai/docs/resources/mcp.md).

---

## More from RunAPI

- [Home](https://runapi.ai/.md)
- [Models](https://runapi.ai/models.md)
- [AI Video API Comparison](https://runapi.ai/ai-video-api-comparison.md)
- [OpenClaw Integration](https://runapi.ai/openclaw.md)
- [Best API for OpenClaw](https://runapi.ai/best-api-for-openclaw.md)
- [OpenClaw Image Generation](https://runapi.ai/openclaw-image-generation.md)
- [Hermes Agent Integration](https://runapi.ai/hermes-agent.md)
- [Pricing](https://runapi.ai/pricing.md)
- [Claude API Pricing](https://runapi.ai/claude-api-pricing.md)
- [ChatGPT API Pricing](https://runapi.ai/chatgpt-api-pricing.md)
- [OpenAI API Pricing](https://runapi.ai/openai-api-pricing.md)
- [Gemini API Pricing](https://runapi.ai/gemini-api-pricing.md)
- [Claude Code Pricing](https://runapi.ai/claude-code-pricing.md)
- [Claude Code API](https://runapi.ai/claude-code-api.md)
- [Claude Code vs Cursor](https://runapi.ai/claude-code-vs-cursor.md)
- [Claude Max vs API](https://runapi.ai/claude-max-vs-api.md)
- [Requesty Alternative](https://runapi.ai/requesty-alternative.md)
- [Docs](https://runapi.ai/docs/guides)
- [SDK](https://runapi.ai/sdk.md)
- [Skills](https://runapi.ai/skills.md)
- [MCP Server](https://runapi.ai/mcp.md)
- [CLI](https://runapi.ai/cli.md)
- [Feedback](https://runapi.ai/)
- [Contact](mailto:support@runapi.ai)
- [Terms](https://runapi.ai/terms.md)
- [Privacy](https://runapi.ai/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/icon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "TechArticle",
    "headline": "Claude Code",
    "description": "Install Claude Code, connect it to RunAPI, choose a model, and verify the configuration.",
    "url": "https://runapi.ai/docs/resources/tool-integrations/claude-code",
    "mainEntityOfPage": "https://runapi.ai/docs/resources/tool-integrations/claude-code"
  }
]
```
