Skip to main content
POST
Chat completion with vision: DeepSeek V4 Flash Vision
テストする前に、default グループに token が含まれていることを確認してください。ClaudeCode の token でもここでは 200 が返りますが、detail、thinking の切り替えと logprobs は すべて動作しなくなり、レスポンスから completion_tokens_details フィールドが消えます —— そのため、 パラメータの指定を間違えたように見えますが、実際にはグループが違うだけです。Anthropic 形式の場合は、代わりに メッセージ プレイグラウンド を使用してください。
右側のプレイグラウンドで直接テストできます: Bearer sk-your-api-key認証 に入れてください。例では公開画像を使用し、thinking は無効になっているため、送信を押すと すぐにレスポンスを確認できます。ローカルファイルの場合は、image_url.urldata:image/jpeg;base64,<BASE64> に変更してください。

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

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

image_url を base64 データ URL で送信する

image_url を公開リンクで送信する

URL は最大 8192 文字までで、60 秒以内にダウンロードできる必要があります。

file ブロックを file_data 付きで送信する

token コストは image_url チャネルと同じです(同じ画像ならどちらの方法でも 303 です)。
detailfile ブロック上での指定は黙って無視されます —— エラーにもならず、保存もされません。 detail: "low" を使うには、画像を image_url チャネル経由で送信してください。また、file_id(Files API)はこのプラットフォームでは利用できません。渡すと invalid file_id が返されます。

detailでどれだけ節約できるか

4つのレベルすべてで同じ1600×1200画像: low は、画像の種類の判別、被写体の認識、または大まかな分類には十分です。 小さな文字やグラフの数値を読むには original を使ってください。 列挙外の値ははっきりとエラーになります: unknown variant 'ultra', expected one of 'low', 'high', 'original', 'auto'.

画像が token になる仕組み

1画像あたり384が上限です。複数画像はそれぞれ個別にカウントされ、線形に加算されます。 アップロード前に事前圧縮すると帯域幅は節約できますが、tokens は節約できません —— 2000² と 4000² は まったく同じ数に変換されます。完全なルールは 概要をご覧ください。

推論を無効にする2つの方法

どちらも確認済みです(それぞれ3回実行: prompt_tokens は 303 から 223 に下がり、reasoning_content は消えます)。reasoning: {"effort": "none"}enable_thinking: false動作しません
max_tokens が小さすぎると空の content が返ります。 推論を有効にしていると、1行の 質問でも最初に数百 token 分の推論が出力されることがあります。予算が尽きると finish_reason: "length" と空文字列が返り——モデルが応答に失敗したと誤解されがちです。 推論を有効にする場合は 2000 以上にするか、単純に無効化してください。

構造化出力が必要ですか? ツールを使ってください

response_format: {"type": "json_schema"} は返します This response_format type is unavailable now(上流モデルの制限です)。 json_object は動作しますが、フィールドを制約しません。強制するには、関数呼び出しを使用してください:
ツール引数も、ストリーミングの増分から正しく組み立てられます。

よくあるエラー

承認

Authorization
string
header
必須

The API Key from the APIYI console; the token must be in the default group

ボディ

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

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

利用可能なオプション:
deepseek-v4-flash-vision-exp
messages
object[]
必須

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

max_tokens
integer
デフォルト:800

Output token budget, hard ceiling 393,216. Thinking text counts against it, so use 2000 or more with thinking on, otherwise content may come back empty

必須範囲: x <= 393216
thinking
object

Thinking toggle. Pass {"type": "disabled"} to turn it off, saving 80 input tokens and all reasoning output. Only effective in the default group

reasoning_effort
enum<string>

Reasoning depth. In testing none reliably disables thinking; low/high/max showed no stable difference. Only effective in the default group

利用可能なオプション:
none,
low,
medium,
high,
max
stream
boolean
デフォルト:false

Stream the response over SSE. Pair with stream_options.include_usage to get usage in the final chunk

response_format
object

Output format. Only {"type": "json_object"} works; json_schema returns This response_format type is unavailable now

temperature
number

Sampling temperature

top_p
number

Nucleus sampling threshold

stop
string[]

Stop sequences

seed
integer

Random seed

logprobs
boolean

Return token log probabilities; populated in testing (default group only)

top_logprobs
integer

Number of candidates per position, range 0-20

必須範囲: 0 <= x <= 20
tools
object[]

Function Call tool list in OpenAI format. Use it instead of json_schema when you need structured output

レスポンス

Chat completion succeeded

id
string

Request ID

object
string
model
string
choices
object[]

Completion results. Besides content, message carries reasoning_content when thinking is on

usage
object

Usage. Tokens converted from images are included in prompt_tokens