curl --request POST \
--url https://api.apiyi.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash-vision-exp",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image? Answer in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.apiyi.com/images/checks-passed.png",
"detail": "original"
}
}
]
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "deepseek-v4-flash-vision-exp",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image? Answer in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.apiyi.com/images/checks-passed.png",
"detail": "original"
}
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'deepseek-v4-flash-vision-exp',
messages: [
{
role: 'user',
content: [
{type: 'text', text: 'What is in this image? Answer in one sentence.'},
{
type: 'image_url',
image_url: {url: 'https://docs.apiyi.com/images/checks-passed.png', detail: 'original'}
}
]
}
]
})
};
fetch('https://api.apiyi.com/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apiyi.com/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'deepseek-v4-flash-vision-exp',
'messages' => [
[
'role' => 'user',
'content' => [
[
'type' => 'text',
'text' => 'What is in this image? Answer in one sentence.'
],
[
'type' => 'image_url',
'image_url' => [
'url' => 'https://docs.apiyi.com/images/checks-passed.png',
'detail' => 'original'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apiyi.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"deepseek-v4-flash-vision-exp\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is in this image? Answer in one sentence.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://docs.apiyi.com/images/checks-passed.png\",\n \"detail\": \"original\"\n }\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apiyi.com/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"deepseek-v4-flash-vision-exp\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is in this image? Answer in one sentence.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://docs.apiyi.com/images/checks-passed.png\",\n \"detail\": \"original\"\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"deepseek-v4-flash-vision-exp\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is in this image? Answer in one sentence.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://docs.apiyi.com/images/checks-passed.png\",\n \"detail\": \"original\"\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "35a4e262-f2b8-4eb7-bdb2-012b02c7012d",
"object": "chat.completion",
"model": "deepseek-v4-flash-vision-exp",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The image shows a notification stating that all checks have passed, including a successful Mintlify deployment."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 295,
"completion_tokens": 49,
"total_tokens": 344,
"prompt_cache_hit_tokens": 0,
"prompt_cache_miss_tokens": 295
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}DeepSeek V4 Flash Vision Chat API 레퍼런스
deepseek-v4-flash-vision-exp에 대한 OpenAI 호환 Chat Completions API 레퍼런스 및 플레이그라운드입니다: 이미지를 보내는 세 가지 방법, token 절감 상세, 추론 토글을 제공합니다. 기본 그룹 token이 필요합니다.
curl --request POST \
--url https://api.apiyi.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash-vision-exp",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image? Answer in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.apiyi.com/images/checks-passed.png",
"detail": "original"
}
}
]
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "deepseek-v4-flash-vision-exp",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image? Answer in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://docs.apiyi.com/images/checks-passed.png",
"detail": "original"
}
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'deepseek-v4-flash-vision-exp',
messages: [
{
role: 'user',
content: [
{type: 'text', text: 'What is in this image? Answer in one sentence.'},
{
type: 'image_url',
image_url: {url: 'https://docs.apiyi.com/images/checks-passed.png', detail: 'original'}
}
]
}
]
})
};
fetch('https://api.apiyi.com/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apiyi.com/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'deepseek-v4-flash-vision-exp',
'messages' => [
[
'role' => 'user',
'content' => [
[
'type' => 'text',
'text' => 'What is in this image? Answer in one sentence.'
],
[
'type' => 'image_url',
'image_url' => [
'url' => 'https://docs.apiyi.com/images/checks-passed.png',
'detail' => 'original'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apiyi.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"deepseek-v4-flash-vision-exp\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is in this image? Answer in one sentence.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://docs.apiyi.com/images/checks-passed.png\",\n \"detail\": \"original\"\n }\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apiyi.com/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"deepseek-v4-flash-vision-exp\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is in this image? Answer in one sentence.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://docs.apiyi.com/images/checks-passed.png\",\n \"detail\": \"original\"\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"deepseek-v4-flash-vision-exp\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What is in this image? Answer in one sentence.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://docs.apiyi.com/images/checks-passed.png\",\n \"detail\": \"original\"\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "35a4e262-f2b8-4eb7-bdb2-012b02c7012d",
"object": "chat.completion",
"model": "deepseek-v4-flash-vision-exp",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The image shows a notification stating that all checks have passed, including a successful Mintlify deployment."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 295,
"completion_tokens": 49,
"total_tokens": 344,
"prompt_cache_hit_tokens": 0,
"prompt_cache_miss_tokens": 295
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}default 그룹에 있는지 확인합니다.ClaudeCode token은 여기에서 여전히 200을 반환하지만, detail, thinking 토글과 logprobs은
모두 작동하지 않고 응답에서 completion_tokens_details 필드가 빠집니다 —— 마치
파라미터를 잘못 작성한 것처럼 보이지만 실제로는 그룹이 잘못된 것입니다. Anthropic 형식의 경우
대신 Messages Playground를 사용합니다.Bearer sk-your-api-key을 넣습니다. 예제는 공개 이미지를 사용하고 thinking이 비활성화되어 있으므로, 전송을 누르면 즉시 응답을 볼 수 있습니다. 로컬 파일의 경우 image_url.url을 data:image/jpeg;base64,<BASE64>으로 변경합니다.매개변수 빠른 참고
| 매개변수 | 유형 | 필수 | 기본값 | 비고 |
|---|---|---|---|---|
model | string | ✓ | — | 항상 deepseek-v4-flash-vision-exp |
messages | array | ✓ | — | content는 문자열이거나, 텍스트와 이미지를 혼합할 때는 부분들의 배열입니다 |
max_tokens | int | — | 출력 예산, 절대 상한 393,216; 추론을 켠 상태에서는 2000+를 사용하십시오 | |
thinking.type | string | enabled | disabled는 안정적으로 추론을 끄며 입력 token 80개를 절약합니다 | |
reasoning_effort | string | — | none는 추론 비활성화와 같습니다. 낮음/높음/최대는 안정적인 차이를 보이지 않습니다 | |
response_format | object | — | json_object만 작동하며 json_schema는 오류가 발생합니다 | |
stream | bool | false | SSE 스트리밍; 사용량을 위해 stream_options.include_usage와 함께 사용합니다 | |
temperature / top_p / stop / seed | — | — | 모두 유효합니다 | |
logprobs / top_logprobs | — | — | 유효합니다; top_logprobs 범위는 0–20입니다 | |
tools | array | — | 함수 호출; 구조화된 출력을 위해 json_schema 대신 사용합니다 |
이미지를 전송하는 세 가지 방법
image_url와 함께 base64 data URL 사용
{
"type": "image_url",
"image_url": {"url": "data:image/jpeg;base64,<BASE64>", "detail": "original"}
}
공개 링크와 함께 image_url 사용
{
"type": "image_url",
"image_url": {"url": "https://example.com/image.jpg", "detail": "low"}
}
file_data이 포함된 file 블록
{
"type": "file",
"file_data": "data:image/jpeg;base64,<BASE64>",
"filename": "image.jpg"
}
image_url 채널과 동일합니다(같은 이미지에 대해 어느 쪽이든 303입니다).
file 블록의 detail는 조용히 무시됩니다 —— 오류도 없고 저장도 되지 않습니다.
detail: "low"를 사용하려면, 이미지를 image_url 채널을 통해 보내십시오.또한, file_id(Files API)는 이 플랫폼에서 사용할 수 없습니다; 하나를 전달하면
invalid file_id가 반환됩니다.detail이 절약되는 양
네 가지 수준 모두에서 동일한 1600×1200 이미지입니다:
detail | 이미지 tokens | original 대비 |
|---|---|---|
low | 142 | -60% |
high | 354 | 동일 |
original | 354 | 기준값 |
auto | 354 | 동일 |
low이면 충분합니다.
작은 텍스트나 차트 값을 읽을 때는 original을 남겨 두십시오.
열거형에 없는 값은 명확하게 실패합니다:
unknown variant 'ultra', expected one of 'low', 'high', 'original', 'auto'.
이미지가 token으로 변환되는 방식
| 이미지 크기 | Tokens |
|---|---|
| 64×64 | 114 |
| 384×384 | 114 |
| 800×800 | 346 |
| 2000×2000 | 346 |
| 4000×4000 | 346 |
| 1600×400 | 266 |
| 1600×1200 | 354 |
추론을 비활성화하는 두 가지 방법
{ "thinking": { "type": "disabled" } }
{ "reasoning_effort": "none" }
prompt_tokens가 303에서 223으로 감소하고 reasoning_content이 사라집니다). reasoning: {"effort": "none"}과 enable_thinking: false는 작동하지 않습니다.
max_tokens가 너무 작으면 빈 content를 반환합니다. 추론이 켜져 있으면 한 줄짜리
질문도 먼저 수백 개의 reasoning token을 내보낼 수 있습니다. 예산이 소진되면
finish_reason: "length"와 빈 문자열이 반환되며 —— 모델이 응답하지 못한 것처럼 쉽게 오해될 수 있습니다.
추론이 켜진 상태에서는 2000 이상을 사용하거나, 아니면 단순히 비활성화하십시오.구조화된 출력이 필요하신가요? tools를 사용하세요
response_format: {"type": "json_schema"}는 반환합니다
This response_format type is unavailable now (상위 모델의 한계입니다).
json_object는 작동하지만 필드를 제약하지는 않습니다. 강제하려면 Function Call을 사용하십시오:
{
"model": "deepseek-v4-flash-vision-exp",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Look at the image and call record_shape."},
{"type": "image_url", "image_url": {"url": "https://example.com/shape.jpg"}}
]
}],
"tools": [{
"type": "function",
"function": {
"name": "record_shape",
"parameters": {
"type": "object",
"properties": {
"shape": {"type": "string"},
"color": {"type": "string"}
},
"required": ["shape", "color"]
}
}
}]
}
일반적인 오류
| 오류 | 원인 |
|---|---|
You have uploaded an unsupported image | 형식이 JPEG/PNG/GIF/WebP가 아니거나, base64가 손상되었습니다 |
Failed to download image | URL에 연결할 수 없거나 60초를 초과했습니다 |
image file size exceeds limit 32 MB | 이미지 크기가 32 MiB보다 큽니다 |
external link length … too long, max link length 8192 | URL이 너무 깁니다 |
Image in assistant message is unsupported | 이미지는 user 메시지에만 나타날 수 있습니다 |
valid range of max_tokens is [1, 393216] | max_tokens이 상한을 초과했습니다 |
invalid file_id | file_id을 사용했습니다; 이 플랫폼은 Files API를 제공하지 않습니다 |
인증
The API Key from the APIYI console; the token must be in the default group
본문
Model ID, always deepseek-v4-flash-vision-exp
deepseek-v4-flash-vision-exp Message array. content is either a plain string or an array of content parts for mixed text and images
Show child attributes
Show child attributes
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 <= 393216Thinking toggle. Pass {"type": "disabled"} to turn it off, saving 80 input tokens and all reasoning output. Only effective in the default group
Show child attributes
Show child attributes
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 the response over SSE. Pair with stream_options.include_usage to get usage in the final chunk
Output format. Only {"type": "json_object"} works; json_schema returns This response_format type is unavailable now
Show child attributes
Show child attributes
Sampling temperature
Nucleus sampling threshold
Stop sequences
Random seed
Return token log probabilities; populated in testing (default group only)
Number of candidates per position, range 0-20
0 <= x <= 20Function Call tool list in OpenAI format. Use it instead of json_schema when you need structured output
이 페이지가 도움이 되었나요?