Loading...
Loading...
完全な API ドキュメント
https://api.thistoken.aiすべての API リクエストは Authorization ヘッダーに API キーを含める必要があります:
Authorization: Bearer YOUR_API_KEY/v1/chat/completionsチャット補完を作成
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| model | string | はい | モデル名 (例: gpt-4o, claude-3.5-sonnet) |
| messages | array | はい | role と content を持つメッセージ配列 |
| temperature | number | いいえ | サンプリング温度、0-2、デフォルト 1 |
| max_tokens | integer | いいえ | 生成する最大 token 数 |
| stream | boolean | いいえ | ストリーミング出力、デフォルト false |
curl https://api.thistoken.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}]
}'/v1/embeddingsテキスト埋め込みベクトルを作成
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| model | string | はい | 埋め込みモデル名 (例: text-embedding-3-small) |
| input | string|array | はい | 埋め込むテキスト |
curl https://api.thistoken.ai/v1/embeddings \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-small",
"input": "Hello world"
}'/v1/models利用可能なモデル一覧を取得
curl https://api.thistoken.ai/v1/models \
-H "Authorization: Bearer $API_KEY"/v1/images/generations画像を生成
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| model | string | はい | 画像モデル (例: dall-e-3) |
| prompt | string | はい | 画像の説明 |
| size | string | いいえ | 画像サイズ (例: 1024x1024) |
curl https://api.thistoken.ai/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dall-e-3",
"prompt": "A cute cat",
"size": "1024x1024"
}'| コード | 説明 |
|---|---|
| 400 | 不正なリクエストパラメータ |
| 401 | 認証失敗 — API キー無効 |
| 402 | 残高不足 |
| 429 | レート制限超過 |
| 500 | サーバー内部エラー |