메인 콘텐츠로 건너뛰기
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 형식에는 채팅 플레이그라운드를 사용하십시오.
오른쪽의 플레이그라운드를 사용하여 직접 테스트하십시오. sk-your-apiyi-key을 x-api-key에 입력하고 (Bearer 접두사가 없는 ClaudeCode token) anthropic-version은 2023-06-01으로 유지하십시오. 이 예제에서는 공개 이미지를 사용하고 추론 기능이 비활성화되어 있으므로, 전송을 클릭하면 즉시 응답을 확인할 수 있습니다.

매개변수 빠른 참조

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

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

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

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

멀티 턴 및 도구 왕복

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

캐시 필드의 의미

APIYI의 Anthropic 네이티브 /v1/messages 엔드포인트를 통해 DeepSeek을 호출할 때 캐시 과금을 적용받으려면 token에서 전용 ClaudeCode 그룹을 사용해야 합니다. 이 그룹은 기본적으로 5% 할인을 제공합니다.
OpenAI 호환 /v1/chat/completions은 이미 default 그룹에서 캐시 과금을 지원하므로 ClaudeCode를 선택할 필요가 없습니다.
실제 캐시 적중 여부는 요청 컨텍스트에 따라 달라지며, 올바른 그룹을 사용하더라도 보장되지 않습니다.
자동 접두사 캐싱이 적용되며, 표준 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