Skip to Content
aicentos
API エンドポイントチャット API

ネイティブ Claude 形式

最終更新:

チャット(Chat)

POST /messages

認証

API キーを環境変数 AICENTOS_API_KEY に設定してください。シェルの例では、その値を Authorization: Bearer ヘッダーに展開します。

コンソールの「トークン管理」で取得した API Key

場所:header

リクエストボディ

application/json

TypeScript 型定義

TypeScript で request body 型を使用する

レスポンスボディ

application/json

application/json

application/json

export AICENTOS_API_KEY="sk-your-aicentos-api-key"

curl -X POST "https://aicentos.com/v1/messages" \
  -H "Authorization: Bearer $AICENTOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{    "model": "claude-sonnet-4-6",    "max_tokens": 256,    "messages": [      {        "role": "user",        "content": "自分を一文で紹介してください"      }    ]  }'
{
  "id": "string",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "string"
    }
  ],
  "model": "string",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  }
}
{
  "error": {
    "message": "Incorrect API key provided",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}
{
  "error": {
    "message": "Incorrect API key provided",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}