Skip to main content
POST
Messages with vision: DeepSeek V4 Flash Vision (Anthropic format)
この endpoint 用の token は ClaudeCode グループに含まれていなければなりません。これは必須条件です。default グループを使うと、2つの問題が重なって発生します。
  1. top_p を省略すると、毎回 400 Invalid top_p value が返ります
  2. top_p を指定しても、最初のターンの thinking ブロックを2回目のターンに再送すると unknown variant 'thinking', expected one of 'text', 'image_url', 'file' が返ります —— そして Claude Code や Anthropic SDK などの標準クライアントは常にこれを再送するため、 マルチターンは常に壊れます
ClaudeCode グループに切り替えれば、どちらの問題も発生しません。OpenAI フォーマットの場合は、 代わりに Chat Playground をご利用ください。
右側の playground を使って直接テストできます。x-api-keysk-your-apiyi-key を入れ (ClaudeCode token で、Bearer プレフィックスはありません)、anthropic-version2023-06-01 のままにしてください。 この例では公開画像を使用し、thinking は無効化されているため、送信するとすぐに response を確認できます。

パラメータのクイックリファレンス

画像を送信する2つの方法

source.type = "base64"

なお、data には data:image/jpeg;base64, プレフィックスがありません——これは OpenAI 形式とは異なります。

source.type = "url"

source.type = "url"ClaudeCode グループでのみ機能します。default グループでは You have uploaded an unsupported image が返されます。source.type = "file" には Files API が必要ですが、このプラットフォームでは提供していません。

レスポンス content は block 配列です

ClaudeCode グループでは、thinking ブロックに signature フィールドが含まれ、ストリーミングでは signature_delta も出力されます。

マルチターンとツールの往復

前回のアシスタントターンのcontent全体をmessagesに戻してください—— thinking ブロックも含めて、 削除しないでください —— そして tool_result を追記します:
テストでは 2 回目のターンは成功します。これはまさに default グループが 400 を返す場所です、 そしてこれはすべての Claude Code スタイルのクライアントがたどるパスです——だからこそ、グループは正しくなければなりません。

キャッシュフィールドの読み方

自動プレフィックスキャッシュが適用され、標準のAnthropicフィールドに対応します: 画像を含むリクエストは3回目の呼び出しで最初のヒットになります(テキストのみの場合は2回目)。固定の長い指示は、キャッシュされるように画像のに置いてください。

よくあるエラー

承認

x-api-key
string
header
必須

Your APIYI token, the raw sk- key. The token must be in the ClaudeCode group

ヘッダー

anthropic-version
string
デフォルト:2023-06-01
必須

Anthropic API version, always 2023-06-01

ボディ

application/json
model
enum<string>
デフォルト:deepseek-v4-flash-vision-exp
必須

Model ID, always deepseek-v4-flash-vision-exp

利用可能なオプション:
deepseek-v4-flash-vision-exp
max_tokens
integer
デフォルト:800
必須

Output token budget (required in the Anthropic format), hard ceiling 393,216. Use 2000 or more with thinking on

必須範囲: x <= 393216
messages
object[]
必須

Message array. content is either a plain string or an array of content blocks for mixed text and images

system
string

System prompt

thinking
object

Thinking toggle. With {"type": "disabled"} the response content holds only a text block. Works in both groups on this endpoint

stream
boolean
デフォルト:false

Stream the response over SSE, emitting the standard Anthropic message_start / content_block_delta / message_stop events

temperature
number

Sampling temperature

top_p
number

Nucleus sampling threshold. Optional in the ClaudeCode group; in the default group, omitting it returns 400

top_k
integer

Candidate cutoff

stop_sequences
string[]

Stop sequences

tools
object[]

Tool list in the standard Anthropic input_schema format. Verified with streaming increments and a full two-turn round trip

レスポンス

Generation succeeded

id
string
type
string
role
string
model
string
content
object[]

Array of content blocks. [thinking, text] with thinking on, just [text] with it off, and [thinking, tool_use] when calling a tool

stop_reason
string
usage
object

Usage. Note this differs from the OpenAI format: after a cache hit input_tokens holds only the uncached remainder, so it cannot be reconciled with prompt_tokens directly