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

# Anthropic 兼容

除了 OpenAI 兼容以外，极客智坊还提供了针对 Anthropic API 兼容的接口服务，以便在 Claude Code 等编程工具中使用，该接口目前支持以下模型：

* Claude 全系模型
* GLM 家族：GLM-4.5系列、GLM-4.6系列、GLM-4.7系列、GLM-5系列、GLM-5.1系列
* MiniMax 家族：MiniMax-M2、MiniMax-M2.1、MiniMax-M2.5、MiniMax-M2.7系列
* 千问家族：Qwen3系列、Qwen3.5系列、Qwen3.6系列
* 豆包家族：Doubao-Seed-2.0系列、Doubao-Seed-Code
* Kimi家族：Kimi-K2、Kimi-K2.5、Kimi-K2.6
* 小米家族：Mimo-V2系列、Mimo-V2.5系列
* DeepSeek家族：DeepSeek-R1、DeepSeek-V3、DeepSeek-V3.1、DeepSeek-V3.2系列

你可以通过 Anthropic SDK 来调用这些模型，使用方法和调用 OpenAI 兼容模型类似，只需要将 Base URL 和 API KEY 替换成极客智坊的 Base URL 和 API KEY 即可，其他参数和调用方式与官方 Anthropic API 保持一致：

<div style={{ width: '100%', overflowX: 'auto' }}>
  <table style={{ width: '100%', borderCollapse: 'collapse', tableLayout: 'fixed' }}>
    <thead>
      <tr>
        <th style={{ border: '1px solid #ccc', padding: '10px', }}>参数</th>
        <th style={{ border: '1px solid #ccc', padding: '10px',width: '80%' }}>值</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td style={{ border: '1px solid #ccc', padding: '8px' }}>Base URL</td>

        <td style={{ border: '1px solid #ccc', padding: '8px' }}>
          国内版调用入口： `https://geekai.co/api` <br />
          海外版调用入口： `https://geekai.dev/api`
        </td>
      </tr>

      <tr>
        <td style={{ border: '1px solid #ccc', padding: '8px' }}>API KEY</td>

        <td style={{ border: '1px solid #ccc', padding: '8px' }}>
          国内版 API KEY：<a href="https://geekai.co/user/api_keys" target="_blank">[https://geekai.co/user/api\_keys](https://geekai.co/user/api_keys)</a> <br />
          海外版 API KEY：<a href="https://geekai.dev/user/api_keys" target="_blank">[https://geekai.dev/user/api\_keys](https://geekai.dev/user/api_keys)</a> <br />
          API KEY 与代理渠道关联，不同渠道对应不同折扣值，可通过编辑 API KEY 切换。
        </td>
      </tr>
    </tbody>
  </table>
</div>

以下是代码调用示例：

<CodeGroup>
  ```bash curl theme={null}
  curl https://geekai.co/api/v1/messages \
  -H "content-type: application/json" \
  -H "x-api-key: $GEEKAI_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
      "model": "claude-opus-4-7",
      "max_tokens": 1024,
      "messages": [{
        "role": "user",
        "content": "Hello, Claude"
      }]
  }'
  ```

  ```bash python theme={null}
  import anthropic

  client = anthropic.Anthropic(
      api_key="$GEEKAI_API_KEY",
      base_url="https://geekai.co/api"
  )

  message = client.messages.create(
      model="claude-opus-4-7",
      max_tokens=1024,
      "messages": [{
        "role": "user",
        "content": "Hello, Claude"
      }]
  )

  print(message.content[0].text)
  ```

  ```bash javascript theme={null}
  import Anthropic from "@anthropic-ai/sdk";

  const client = new Anthropic(
    apiKey: process.env.GEEKAI_API_KEY,
    baseURL: "https://geekai.co/api",
  );

  const msg = await client.messages.create({
    model: "claude-opus-4-7",
    max_tokens: 1024,
    messages: [{
      role: "user",
      content: "Hello, Claude"
    }],
  });
  console.log(msg.content[0].text);
  ```

  ```bash go theme={null}
  import anthropic "github.com/anthropics/anthropic-sdk-go"

  client := anthropic.NewClient(
    option.WithAPIKey("$GEEKAI_API_KEY"),
    option.WithBaseURL("https://geekai.co/api"), 
  )

  msg, _ := client.Messages.New(
    context.TODO(),
    anthropic.MessageNewParams{
      Model:     anthropic.ModelClaudeOpus4_7,
      MaxTokens: 1024,
      Messages: []anthropic.MessageParam{
        anthropic.NewUserMessage(
          anthropic.NewTextBlock("Hello, Claude"),
        ),
      },
    },
  )
  fmt.Println(msg.Content[0].Text)
  ```
</CodeGroup>
