Skip to main content
POST
Messages with vision: DeepSeek V4 Flash Vision (Anthropic format)
Your token for this endpoint must be in the ClaudeCode group. This is a hard requirement.Using the default group hits two stacked problems:
  1. Omitting top_p returns 400 Invalid top_p value every time
  2. Even with top_p supplied, replaying the first turn’s thinking block into the second turn returns unknown variant 'thinking', expected one of 'text', 'image_url', 'file' —— and standard clients such as Claude Code and the Anthropic SDK always replay it, so multi-turn always breaks
Switch to the ClaudeCode group and neither problem exists. For the OpenAI format use the Chat Playground instead.
Use the playground on the right to test directly: put sk-your-apiyi-key in x-api-key (a ClaudeCode token, with no Bearer prefix) and leave anthropic-version at 2023-06-01. The example uses a public image and has thinking disabled, so you can hit send and see a response immediately.

Parameter quick reference

Two ways to send an image

source.type = "base64"

Note that data carries no data:image/jpeg;base64, prefix —— this differs from the OpenAI format.

source.type = "url"

source.type = "url" works only in the ClaudeCode group; the default group returns You have uploaded an unsupported image.source.type = "file" needs the Files API, which this platform does not offer.

The response content is a block array

In the ClaudeCode group the thinking block carries a signature field, and streaming emits signature_delta as well.

Multi-turn and the tool round trip

Put the previous assistant turn’s entire content back into messages —— including the thinking block, do not strip it —— then append the tool_result:
The second turn succeeds in testing. This is exactly where the default group returns 400, and it is the path every Claude Code style client takes —— which is why the group must be right.

How the cache fields read

Automatic prefix caching applies, mapped onto the standard Anthropic fields: Requests with an image first hit on the 3rd call (text-only hits on the 2nd). Put your fixed long instructions before the image for them to be cached.

Common errors

Authorizations

x-api-key
string
header
required

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

Headers

anthropic-version
string
default:2023-06-01
required

Anthropic API version, always 2023-06-01

Body

application/json
model
enum<string>
default:deepseek-v4-flash-vision-exp
required

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

Available options:
deepseek-v4-flash-vision-exp
max_tokens
integer
default:800
required

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

Required range: x <= 393216
messages
object[]
required

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
default: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

Response

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