マーケットサポート← アプリに戻る

埋め込み API

テキストをベクトル埋め込みに変換し、セマンティック検索・RAG・クラスタリング・分類に利用します。埋め込みは Cohere 経由で提供され、入力トークン数に応じてクレジット残高から課金されます。

概要

1 つ以上の文字列を送信すると、入力ごとに float ベクトルが返ります。生成と異なり、これは単一の同期呼び出しで — タスクのポーリングは不要です。

認証

/api-keys で API キーを作成し、Bearer トークンとして送信します。

Authorization: Bearer <YOUR_API_KEY>

埋め込みの作成

POST
POST https://97ai.97claude.com/api/embeddings
cURL
curl -X POST "https://97ai.97claude.com/api/embeddings" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "embed/embed-4.0",
    "input": ["hello world", "a second document"],
    "input_type": "search_document"
  }'

パラメータ

model string 必須

埋め込みモデルの slug(例:embed/embed-4.0)。

input string | string[] 必須

1 つのテキスト、または最大 96 件のテキスト配列。

input_type string 任意

search_document(デフォルト)、search_queryclassificationclustering

レスポンス

JSON
{
  "model": "embed/embed-4.0",
  "embeddings": [[0.0123, -0.0456, ...], [0.0789, ...]],
  "tokens": 12,
  "credits": 1,
  "balance": 9998
}
課金
入力トークン数 × モデル単価 × プラットフォームのマークアップ を切り上げて課金します(1 リクエストあたり最低 1 クレジット)。

モデル

モデルプロバイダーslug価格
Cohere Embed 4.0Cohereembed/embed-4.0$0.12 / 1M tokens