本文へ移動
メイン ドキュメント
ドキュメント

Anthropic SDK

api.kotoba.cloud does not serve the Anthropic Messages wire (POST /v1/messages) — measured 405 on 2026-09-15. The Anthropic SDK cannot speak the OpenAI wire by changing base_url, so there are two options.

1. Switch to the OpenAI SDK

In your own code this is the shortest path; the messages shape is nearly the same (system becomes the leading turn; tool results are role: tool).

2. Put a translating proxy in between

A client that speaks only the Anthropic protocol (Claude Code, for example) points at a local proxy that translates Anthropic → OpenAI (LiteLLM's proxy mode, for one); the proxy calls kotoba.cloud.

litellm config.yaml
model_list:
  - model_name: kotoba
    litellm_params:
      model: openai/qwen3.8-flash-next-whitehacker
      api_base: https://api.kotoba.cloud/v1
      api_key: os.environ/KOTOBA_API_TOKEN

# litellm --config config.yaml --port 4000
# export ANTHROPIC_BASE_URL=http://127.0.0.1:4000
# export ANTHROPIC_API_KEY=anything   # the proxy holds the real token

Admission is the same through a proxy (verification, scope, quota, guardrails). Tool definitions and tool_calls are translated by the proxy. Native support for the Messages wire is under consideration; this page changes when it lands.