> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Anthropic API 호환성 (Beta)

## 개요

Anthropic API 생태계를 활용하려는 개발자들의 요구를 충족시키기 위해, 저희 API는 이제 **Anthropic API 인터페이스를 통한 모든 모델 액세스**를 지원합니다.\
**200개 이상의 LLM**을 지원하며, 그중 **7개의 무료 모델**이 포함되어 있습니다.

## 빠른 시작

### Anthropic SDK 설치

<CodeGroup>
  ```shellscript Python theme={null}
  pip install -U anthropic
  ```

  ```shellscript Node.js theme={null}
  npm install @anthropic-ai/sdk
  ```
</CodeGroup>

### API 사용법

**엔드포인트:** `https://aihubmix.com/v1/messages`

<CodeGroup>
  ```shellscript Curl theme={null}
  curl https://aihubmix.com/v1/messages \
    -H "Content-Type: application/json" \
    -H "x-api-key: <AIHUBMIX_API_KEY>" \
    -H "anthropic-version: 2023-06-01" \
    -d '{
      "model": "minimax-m2.1",
      "max_tokens": 16000,
      "thinking": {
        "type": "enabled",
        "budget_tokens": 10000
      },
      "messages": [
        {
          "role": "user",
          "content": "Are there an infinite number of prime numbers such that n mod 4 == 3?"
        }
      ]
    }'
  ```

  ```python Python theme={null}
  from anthropic import Anthropic

  client = Anthropic(
    api_key="<AIHUBMIX_API_KEY>",
    base_url="https://aihubmix.com"
  )

  response = client.messages.create(
    model="glm-4.7",
    max_tokens=16000,
    thinking={
        "type": "enabled",
        "budget_tokens": 10000
    },
    messages=[
        {
            "role": "user",
            "content": "Are there an infinite number of prime numbers such that n mod 4 == 3?"
        }
    ]
  )

  # The response contains summarized thinking blocks and text blocks
  for block in response.content:
      if block.type == "thinking":
          print(f"\nThinking summary: {block.thinking}")
      elif block.type == "text":
          print(f"\nResponse: {block.text}")
  ```
</CodeGroup>

## 호환성 참고 사항

### 지원되는 파라미터

Anthropic API를 통한 통합 시 다음 입력 파라미터를 지원합니다:

| 파라미터          | 타입                                | 필수  | 설명                                                         |
| ------------- | --------------------------------- | --- | ---------------------------------------------------------- |
| `model`       | string                            | 예   | 지원되는 모델은 [모델 목록](https://aihubmix.com/models)에서 확인할 수 있습니다 |
| `messages`    | array of MessageParam             | 예   | 입력 메시지                                                     |
| `max_tokens`  | number                            | 아니오 | 생성할 최대 토큰 수                                                |
| `stream`      | boolean                           | 아니오 | 스트리밍 응답 활성화                                                |
| `system`      | string or array of TextBlockParam | 예   | 시스템 프롬프트                                                   |
| `temperature` | number                            | 아니오 | 범위: (0.0, 1.0]. 출력 무작위성을 제어하며, 권장 값은 1입니다                  |
| `top_p`       | number                            | 아니오 | 누클리어스 샘플링 파라미터                                             |
| `thinking`    | ThinkingConfigParam               | 아니오 | 추론 구성                                                      |

### 지원되는 메시지 타입

| 타입                   | 설명       |
| -------------------- | -------- |
| `type="text"`        | 텍스트 메시지  |
| `type="tool_use"`    | 도구 호출    |
| `type="tool_result"` | 도구 호출 결과 |
| `type="thinking"`    | 모델 추론 출력 |

## 사용 예시

### Claude Code에서 GPT-5.2 사용

지원되는 모든 모델을 AIHubMix를 통해 사용할 수 있지만, 최상의 경험을 위해 **gpt-5.2** 또는 **glm-4.7**과 같은 고성능 모델을 권장합니다.

#### 1. Claude Code 설치 및 구성

Claude Code 설치 가이드를 참조하세요: [https://docs.aihubmix.com/cn/api/Claude-Code](https://docs.aihubmix.com/cn/api/Claude-Code)

#### 2. Claude Code를 AIHubMix에 연결

**Claude 구성 파일:** `.claude/settings.json`

```json theme={null}
{
  "env": {
    "ANTHROPIC_API_KEY": "AIHUBMIX_API_KEY",
    "ANTHROPIC_BASE_URL": "https://aihubmix.com",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5.2",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5.2",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.2",
    "ANTHROPIC_MODEL": "gpt-5.2"
  },
  "includeCoAuthoredBy": false
}
```

`AIHUBMIX_API_KEY`를 실제 AIHubMix API 키로 교체하세요.

<Tip>
  네이티브 Claude Code 설치 프로그램은 표준 `.env` 파일을 읽을 수 없습니다. 이러한 설정을 `.env` 파일에 배치하지 마세요.
</Tip>

#### 3. 대화 시작

프로젝트 디렉토리로 이동한 다음 Claude Code를 실행하세요:

```bash theme={null}
$ cd /path/to/your-project
> claude
```

성공적으로 연결되면 보내는 모든 프롬프트가 AIHubMix를 통해 라우팅됩니다.

#### 4. 검증

Claude Code에서 `/status` 명령을 실행하여 연결을 확인할 수 있습니다:

```bash theme={null}
> /status

 API key: ANTHROPIC_API_KEY
 Anthropic base URL: https://aihubmix.com

 Model: gpt-5.2
```

***

마지막 업데이트: 2026-06-01
