Skip to main content
POST
Messages with vision: DeepSeek V4 Flash Vision (Anthropic format)
이 엔드포인트용 token은 반드시 ClaudeCode 그룹에 있어야 합니다. 이는 반드시 지켜야 하는 필수 조건입니다.default 그룹을 사용하면 두 가지 문제가 겹칩니다.
  1. top_p을 생략하면 매번 400 Invalid top_p value가 반환됩니다
  2. top_p를 제공하더라도 첫 턴의 thinking 블록을 두 번째 턴에 다시 전송하면 unknown variant 'thinking', expected one of 'text', 'image_url', 'file'가 반환됩니다 —— 그리고 Claude Code와 Anthropic SDK 같은 표준 클라이언트는 항상 이를 다시 전송하므로 멀티턴은 항상 깨집니다
ClaudeCode 그룹으로 전환하면 두 문제 모두 사라집니다. OpenAI 형식의 경우에는 채팅 플레이그라운드를 대신 사용하십시오.
오른쪽의 플레이그라운드를 사용하여 직접 테스트하십시오: x-api-keysk-your-apiyi-key를 넣고 (ClaudeCode token이며 Bearer 접두사는 없습니다) anthropic-version2023-06-01로 두십시오. 이 예시는 공개 이미지를 사용하고 thinking이 비활성화되어 있으므로, 전송하면 즉시 응답을 볼 수 있습니다.

매개변수 빠른 참조

이미지를 전송하는 두 가지 방법

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"에는 파일 API가 필요하지만, 이 플랫폼에서는 제공하지 않습니다.

응답 콘텐츠는 블록 배열입니다

ClaudeCode 그룹에서는 thinking 블록에 signature 필드가 포함되며, 스트리밍 시 signature_delta도 함께 전송됩니다.

멀티턴과 툴 왕복

이전 어시스턴트 턴의 전체 contentmessages에 다시 넣습니다 —— thinking 블록을 포함해, 제거하지 마십시오 —— 그런 다음 tool_result를 추가합니다:
두 번째 턴은 테스트에서는 성공합니다. 바로 이 지점에서 default 그룹이 400을 반환합니다, 그리고 이는 모든 Claude Code 스타일 클라이언트가 거치는 경로입니다 —— 따라서 그룹이 정확해야 합니다.

캐시 필드의 해석 방식

자동 프리픽스 캐싱이 적용되며, 표준 Anthropic 필드에 매핑됩니다: image가 포함된 요청은 3번째 호출에서 처음 적중합니다(텍스트만 있는 경우는 2번째 호출에서 적중합니다). 고정된 긴 지시사항은 캐시되도록 image 앞에 배치하십시오.

일반적인 오류

인증

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