@ailib-official/ai-protocol 0.8.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/dist/v1/models/deepseek-chat.json +4 -4
- package/dist/v1/models/gemini.json +59 -1
- package/dist/v1/providers/gemini.json +11 -1
- package/dist/v2/contracts/anthropic-messages.contract.json +62 -0
- package/dist/v2/contracts/gemini-generate.contract.json +59 -0
- package/dist/v2/providers/anthropic.json +42 -10
- package/dist/v2/providers/cohere.json +21 -0
- package/dist/v2/providers/deepseek.json +121 -47
- package/dist/v2/providers/doubao.json +23 -8
- package/dist/v2/providers/google.json +39 -0
- package/dist/v2/providers/groq.json +223 -0
- package/dist/v2/providers/jina.json +15 -0
- package/dist/v2/providers/moonshot.json +23 -8
- package/dist/v2/providers/nvidia.json +520 -0
- package/dist/v2/providers/openai.json +39 -11
- package/dist/v2/providers/qwen.json +25 -9
- package/dist/v2/providers/zhipu.json +114 -22
- package/package.json +12 -3
- package/schemas/v1.json +1 -1
- package/schemas/v2/availability.json +12 -0
- package/schemas/v2/capabilities.json +4 -0
- package/schemas/v2/error-codes.yaml +5 -0
- package/schemas/v2/metadata-model-entry.json +57 -0
- package/schemas/v2/pack.json +145 -0
- package/schemas/v2/provider-contract.json +45 -0
- package/schemas/v2/provider.json +15 -2
- package/schemas/v2/tool-calling.json +61 -0
- package/v1/models/deepseek-chat.yaml +4 -4
- package/v1/models/gemini.yaml +31 -1
- package/v1/providers/gemini.yaml +10 -2
- package/v2/contracts/anthropic-messages.contract.yaml +55 -0
- package/v2/contracts/gemini-generate.contract.yaml +52 -0
- package/v2/packs/examples/README.md +9 -0
- package/v2/packs/examples/deepseek-economy-pack.json +43 -0
- package/v2/providers/anthropic.yaml +34 -13
- package/v2/providers/cohere.yaml +16 -3
- package/v2/providers/deepseek.yaml +77 -33
- package/v2/providers/doubao.yaml +18 -8
- package/v2/providers/google.yaml +32 -4
- package/v2/providers/groq.yaml +159 -0
- package/v2/providers/jina.yaml +10 -0
- package/v2/providers/moonshot.yaml +20 -12
- package/v2/providers/nvidia.yaml +405 -0
- package/v2/providers/openai.yaml +33 -11
- package/v2/providers/qwen.yaml +20 -9
- package/v2/providers/zhipu.yaml +70 -23
package/README.md
CHANGED
|
@@ -31,7 +31,13 @@ ai-protocol/
|
|
|
31
31
|
│ ├── multimodal.json # Extended multimodal capabilities schema
|
|
32
32
|
│ ├── provider-contract.json # Provider contract schema
|
|
33
33
|
│ ├── capability-profile.json # Experimental I/O/S phase metadata schema
|
|
34
|
-
│
|
|
34
|
+
│ ├── context-policy.json # Context management policy schema
|
|
35
|
+
│ ├── execution-metadata.json # Wave-5 execution metadata schema
|
|
36
|
+
│ ├── metadata-model-entry.json # Typed metadata.models entries
|
|
37
|
+
│ ├── message-roles.json # Message role enumeration schema
|
|
38
|
+
│ ├── pack.json # Provider pack schema
|
|
39
|
+
│ ├── pricing.json # Optional pricing schema
|
|
40
|
+
│ └── tool-calling.json # Tool calling schema
|
|
35
41
|
├── v1/ # v1.x stable version specification
|
|
36
42
|
│ ├── spec.yaml # Basic specifications: standard parameters, event enumeration
|
|
37
43
|
│ ├── providers/ # Provider configurations (split by vendor for easy PR)
|
|
@@ -44,7 +50,7 @@ ai-protocol/
|
|
|
44
50
|
│ ├── claude.yaml # Claude series models
|
|
45
51
|
│ └── ... # More models
|
|
46
52
|
├── v2/ # v2 formal provider manifests
|
|
47
|
-
│ └── providers/ #
|
|
53
|
+
│ └── providers/ # 12 V2 provider manifests (OpenAI, Anthropic, Google, DeepSeek, …)
|
|
48
54
|
├── v2-alpha/ # v2-alpha experimental version
|
|
49
55
|
│ └── spec.yaml # Experimental operator definitions
|
|
50
56
|
├── tests/ # Cross-runtime compliance test suite
|
|
@@ -183,6 +189,7 @@ npm run validate:schemas # Validate JSON schema syntax only
|
|
|
183
189
|
# Execution governance automation
|
|
184
190
|
npm run drift:check # Detect P0 provider/fixture/case drift
|
|
185
191
|
npm run gate:manifest-consumption # Cross-repo latest-manifest consumption gate
|
|
192
|
+
npm run gate:manifest-authority # Public manifest hygiene (TEST-002, no app provenance)
|
|
186
193
|
npm run gate:compliance-matrix # Cross-repo full compliance matrix gate
|
|
187
194
|
npm run gate:fullchain # One-shot governance fullchain gate
|
|
188
195
|
npm run gate:fullchain:with-rollback # Fullchain + fail-fast rollback drill
|
|
@@ -196,6 +203,7 @@ node scripts/release-gate.js --report-only # Advisory release gate report (non
|
|
|
196
203
|
The canonical validation script is `scripts/validate.js`, which uses AJV v8 with JSON Schema 2020-12 and ajv-formats.
|
|
197
204
|
Execution governance scripts:
|
|
198
205
|
- `scripts/drift-detect.js`: verifies P0 provider readiness coverage across v2 manifests, compliance fixtures, and loading cases
|
|
206
|
+
- `scripts/gate-manifest-authority.js`: blocks hiddenpath URLs and application-specific provenance in manifest trees ([docs/MANIFEST_AUTHORITY.md](docs/MANIFEST_AUTHORITY.md), [ARCH-005])
|
|
199
207
|
- `scripts/gate-manifest-consumption.js`: runs protocol + Rust/Python/TS latest-manifest consumption checks and writes gate report (`reports/manifest-gates/`)
|
|
200
208
|
- `scripts/gate-compliance-matrix.js`: runs protocol + Rust/Python/TS compliance matrix checks and writes gate report (`reports/compliance-gates/`)
|
|
201
209
|
- `scripts/gate-fullchain.js`: orchestrates drift + manifest + compliance + release gates in one run (`reports/fullchain-gates/`)
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"models": {
|
|
5
5
|
"deepseek-chat": {
|
|
6
6
|
"provider": "deepseek",
|
|
7
|
-
"model_id": "deepseek-
|
|
8
|
-
"display_name": "DeepSeek Chat",
|
|
7
|
+
"model_id": "deepseek-v4-pro",
|
|
8
|
+
"display_name": "DeepSeek Chat (V4 Pro)",
|
|
9
9
|
"verification": {
|
|
10
10
|
"status": "verified",
|
|
11
11
|
"verified_at": "2026-01-28",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"deepseek-reasoner": {
|
|
32
32
|
"provider": "deepseek",
|
|
33
|
-
"model_id": "deepseek-
|
|
34
|
-
"display_name": "DeepSeek Reasoner",
|
|
33
|
+
"model_id": "deepseek-v4-flash",
|
|
34
|
+
"display_name": "DeepSeek Reasoner (V4 Flash)",
|
|
35
35
|
"verification": {
|
|
36
36
|
"status": "verified",
|
|
37
37
|
"verified_at": "2026-03-06",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v1.json",
|
|
3
|
-
"protocol_version": "1.
|
|
3
|
+
"protocol_version": "1.5",
|
|
4
4
|
"models": {
|
|
5
5
|
"gemini-2.5-pro": {
|
|
6
6
|
"provider": "gemini",
|
|
@@ -53,6 +53,64 @@
|
|
|
53
53
|
"fast",
|
|
54
54
|
"cost-effective"
|
|
55
55
|
]
|
|
56
|
+
},
|
|
57
|
+
"gemini-2.5-flash-lite": {
|
|
58
|
+
"provider": "gemini",
|
|
59
|
+
"model_id": "gemini-2.5-flash-lite",
|
|
60
|
+
"name": "Gemini 2.5 Flash-Lite",
|
|
61
|
+
"verification": {
|
|
62
|
+
"status": "verified",
|
|
63
|
+
"verified_at": "2026-05-17",
|
|
64
|
+
"source": "https://ai.google.dev/gemini-api/docs/models/gemini-2.5-flash-lite",
|
|
65
|
+
"notes": "Free-tier RPM/RPD vary by account and region; typical AI Studio free band is high concurrency vs Flash/Pro."
|
|
66
|
+
},
|
|
67
|
+
"context_window": 1048576,
|
|
68
|
+
"capabilities": [
|
|
69
|
+
"chat",
|
|
70
|
+
"vision",
|
|
71
|
+
"audio",
|
|
72
|
+
"video",
|
|
73
|
+
"tools",
|
|
74
|
+
"streaming",
|
|
75
|
+
"reasoning"
|
|
76
|
+
],
|
|
77
|
+
"status": "active",
|
|
78
|
+
"tags": [
|
|
79
|
+
"google",
|
|
80
|
+
"multimodal",
|
|
81
|
+
"flash-lite",
|
|
82
|
+
"cost-effective",
|
|
83
|
+
"free-tier"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"gemini-3.1-flash-lite-preview": {
|
|
87
|
+
"provider": "gemini",
|
|
88
|
+
"model_id": "gemini-3.1-flash-lite-preview",
|
|
89
|
+
"name": "Gemini 3.1 Flash-Lite (Preview)",
|
|
90
|
+
"verification": {
|
|
91
|
+
"status": "verified",
|
|
92
|
+
"verified_at": "2026-05-17",
|
|
93
|
+
"source": "https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-lite-preview",
|
|
94
|
+
"notes": "Preview model; availability and quotas may change by region."
|
|
95
|
+
},
|
|
96
|
+
"context_window": 1048576,
|
|
97
|
+
"capabilities": [
|
|
98
|
+
"chat",
|
|
99
|
+
"vision",
|
|
100
|
+
"audio",
|
|
101
|
+
"video",
|
|
102
|
+
"tools",
|
|
103
|
+
"streaming",
|
|
104
|
+
"reasoning"
|
|
105
|
+
],
|
|
106
|
+
"status": "active",
|
|
107
|
+
"tags": [
|
|
108
|
+
"google",
|
|
109
|
+
"multimodal",
|
|
110
|
+
"flash-lite",
|
|
111
|
+
"preview",
|
|
112
|
+
"free-tier"
|
|
113
|
+
]
|
|
56
114
|
}
|
|
57
115
|
}
|
|
58
116
|
}
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"payload_format": "gemini_style",
|
|
22
22
|
"api_families": [
|
|
23
|
-
"generate_content"
|
|
23
|
+
"generate_content",
|
|
24
|
+
"chat_completions"
|
|
24
25
|
],
|
|
25
26
|
"default_api_family": "generate_content",
|
|
26
27
|
"endpoints": {
|
|
@@ -28,6 +29,11 @@
|
|
|
28
29
|
"path": "/models/{model}:generateContent",
|
|
29
30
|
"method": "POST",
|
|
30
31
|
"adapter": "gemini"
|
|
32
|
+
},
|
|
33
|
+
"openai_chat": {
|
|
34
|
+
"path": "/openai/chat/completions",
|
|
35
|
+
"method": "POST",
|
|
36
|
+
"adapter": "openai"
|
|
31
37
|
}
|
|
32
38
|
},
|
|
33
39
|
"services": {
|
|
@@ -275,5 +281,9 @@
|
|
|
275
281
|
"experimental_features": [
|
|
276
282
|
"multimodal_video",
|
|
277
283
|
"multimodal_audio"
|
|
284
|
+
],
|
|
285
|
+
"notes": [
|
|
286
|
+
"OpenAI-compatible Chat Completions: POST {base_url}/openai/chat/completions with Authorization: Bearer <GEMINI_API_KEY> and OpenAI-style JSON body. See https://ai.google.dev/gemini-api/docs/openai",
|
|
287
|
+
"Native GenerateContent continues to use ?key= query authentication as configured under auth.type query_param."
|
|
278
288
|
]
|
|
279
289
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider-contract.json",
|
|
3
|
+
"contract_version": "1.0",
|
|
4
|
+
"provider_id": "anthropic",
|
|
5
|
+
"api_style": "anthropic_messages",
|
|
6
|
+
"api_version": "2023-06-01",
|
|
7
|
+
"request_mapping": {
|
|
8
|
+
"message_format": "anthropic_messages",
|
|
9
|
+
"role_mapping": {
|
|
10
|
+
"system": "system",
|
|
11
|
+
"user": "user",
|
|
12
|
+
"assistant": "assistant",
|
|
13
|
+
"tool": "user"
|
|
14
|
+
},
|
|
15
|
+
"system_message_handling": "top_level_field",
|
|
16
|
+
"content_block_mapping": {
|
|
17
|
+
"text": {
|
|
18
|
+
"wrapper": "content_blocks"
|
|
19
|
+
},
|
|
20
|
+
"image": {
|
|
21
|
+
"format": "anthropic_source",
|
|
22
|
+
"base64_field": "source.data",
|
|
23
|
+
"url_field": "source.url"
|
|
24
|
+
},
|
|
25
|
+
"document": {
|
|
26
|
+
"format": "anthropic_document",
|
|
27
|
+
"type_field": "document",
|
|
28
|
+
"source_wrapper": "anthropic_source",
|
|
29
|
+
"base64_field": "source.data",
|
|
30
|
+
"mime_type_field": "source.media_type",
|
|
31
|
+
"default_mime_type": "application/pdf",
|
|
32
|
+
"ref_resolution": "error_before_encode"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"response_mapping": {
|
|
37
|
+
"content_path": "$.content[?(@.type=='text')].text",
|
|
38
|
+
"finish_reason_path": "$.stop_reason",
|
|
39
|
+
"usage_path": "$.usage",
|
|
40
|
+
"finish_reason_mapping": {
|
|
41
|
+
"end_turn": "stop",
|
|
42
|
+
"max_tokens": "length",
|
|
43
|
+
"tool_use": "tool_calls",
|
|
44
|
+
"stop_sequence": "stop"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"capability_contracts": {
|
|
48
|
+
"streaming": {
|
|
49
|
+
"protocol": "sse",
|
|
50
|
+
"supports_usage_in_stream": true,
|
|
51
|
+
"supports_tool_streaming": true,
|
|
52
|
+
"done_signal": "message_stop"
|
|
53
|
+
},
|
|
54
|
+
"tools": {
|
|
55
|
+
"definition_format": "anthropic_tools",
|
|
56
|
+
"supports_parallel": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"authentication_contract": {
|
|
60
|
+
"method": "api_key_header"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider-contract.json",
|
|
3
|
+
"contract_version": "1.0",
|
|
4
|
+
"provider_id": "google",
|
|
5
|
+
"api_style": "gemini_generate",
|
|
6
|
+
"api_version": "v1beta",
|
|
7
|
+
"request_mapping": {
|
|
8
|
+
"message_format": "gemini_contents",
|
|
9
|
+
"role_mapping": {
|
|
10
|
+
"system": "user",
|
|
11
|
+
"user": "user",
|
|
12
|
+
"assistant": "model",
|
|
13
|
+
"tool": "user"
|
|
14
|
+
},
|
|
15
|
+
"system_message_handling": "prepend_to_user",
|
|
16
|
+
"content_block_mapping": {
|
|
17
|
+
"text": {
|
|
18
|
+
"field": "text",
|
|
19
|
+
"wrapper": "array_of_parts"
|
|
20
|
+
},
|
|
21
|
+
"image": {
|
|
22
|
+
"format": "gemini_inline_data",
|
|
23
|
+
"base64_field": "inlineData.data",
|
|
24
|
+
"mime_type_field": "inlineData.mimeType"
|
|
25
|
+
},
|
|
26
|
+
"document": {
|
|
27
|
+
"format": "gemini_inline_data",
|
|
28
|
+
"source_wrapper": "gemini_inline_data",
|
|
29
|
+
"base64_field": "inlineData.data",
|
|
30
|
+
"mime_type_field": "inlineData.mimeType",
|
|
31
|
+
"default_mime_type": "application/pdf",
|
|
32
|
+
"ref_resolution": "error_before_encode"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"response_mapping": {
|
|
37
|
+
"content_path": "$.candidates[0].content.parts[?(@.text)].text",
|
|
38
|
+
"finish_reason_path": "$.candidates[0].finishReason",
|
|
39
|
+
"usage_path": "$.usageMetadata",
|
|
40
|
+
"finish_reason_mapping": {
|
|
41
|
+
"STOP": "stop",
|
|
42
|
+
"MAX_TOKENS": "length",
|
|
43
|
+
"SAFETY": "content_filter",
|
|
44
|
+
"RECITATION": "content_filter"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"capability_contracts": {
|
|
48
|
+
"streaming": {
|
|
49
|
+
"protocol": "sse",
|
|
50
|
+
"supports_usage_in_stream": true
|
|
51
|
+
},
|
|
52
|
+
"tools": {
|
|
53
|
+
"definition_format": "gemini_declarations"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"authentication_contract": {
|
|
57
|
+
"method": "query_param"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "anthropic",
|
|
4
4
|
"protocol_version": "2.0",
|
|
5
5
|
"name": "Anthropic",
|
|
6
|
-
"version": "4.
|
|
6
|
+
"version": "4.8.0",
|
|
7
7
|
"status": "stable",
|
|
8
8
|
"category": "ai_provider",
|
|
9
9
|
"official_url": "https://docs.anthropic.com",
|
|
@@ -45,6 +45,21 @@
|
|
|
45
45
|
"overloaded_error": "overloaded"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
"availability": {
|
|
49
|
+
"required": false,
|
|
50
|
+
"regions": [
|
|
51
|
+
"global"
|
|
52
|
+
],
|
|
53
|
+
"check": {
|
|
54
|
+
"method": "GET",
|
|
55
|
+
"path": "/models",
|
|
56
|
+
"expected_status": [
|
|
57
|
+
200,
|
|
58
|
+
401
|
|
59
|
+
],
|
|
60
|
+
"timeout_ms": 3000
|
|
61
|
+
}
|
|
62
|
+
},
|
|
48
63
|
"capabilities": {
|
|
49
64
|
"required": [
|
|
50
65
|
"text",
|
|
@@ -67,6 +82,14 @@
|
|
|
67
82
|
"extended_thinking": true,
|
|
68
83
|
"streaming_usage": true,
|
|
69
84
|
"system_messages": true
|
|
85
|
+
},
|
|
86
|
+
"tool_calling": {
|
|
87
|
+
"native": {
|
|
88
|
+
"supported": true,
|
|
89
|
+
"reliability": "full",
|
|
90
|
+
"parallel": true,
|
|
91
|
+
"streaming": true
|
|
92
|
+
}
|
|
70
93
|
}
|
|
71
94
|
},
|
|
72
95
|
"capability_profile": {
|
|
@@ -328,23 +351,32 @@
|
|
|
328
351
|
},
|
|
329
352
|
"metadata": {
|
|
330
353
|
"models": {
|
|
331
|
-
"claude-opus-4-
|
|
354
|
+
"claude-opus-4-8": {
|
|
332
355
|
"context_window": 1000000,
|
|
333
|
-
"max_output_tokens":
|
|
334
|
-
"release_date": "2026-
|
|
356
|
+
"max_output_tokens": 32768,
|
|
357
|
+
"release_date": "2026-06-15",
|
|
335
358
|
"pricing": {
|
|
336
|
-
"input_per_1m":
|
|
337
|
-
"output_per_1m":
|
|
359
|
+
"input_per_1m": 15,
|
|
360
|
+
"output_per_1m": 75
|
|
338
361
|
}
|
|
339
362
|
},
|
|
340
|
-
"claude-sonnet-4-
|
|
341
|
-
"context_window":
|
|
342
|
-
"max_output_tokens":
|
|
343
|
-
"release_date": "
|
|
363
|
+
"claude-sonnet-4-6": {
|
|
364
|
+
"context_window": 1000000,
|
|
365
|
+
"max_output_tokens": 32768,
|
|
366
|
+
"release_date": "2026-06-11",
|
|
344
367
|
"pricing": {
|
|
345
368
|
"input_per_1m": 3,
|
|
346
369
|
"output_per_1m": 15
|
|
347
370
|
}
|
|
371
|
+
},
|
|
372
|
+
"claude-haiku-4-5": {
|
|
373
|
+
"context_window": 200000,
|
|
374
|
+
"max_output_tokens": 64000,
|
|
375
|
+
"release_date": "2025-10-01",
|
|
376
|
+
"pricing": {
|
|
377
|
+
"input_per_1m": 0.8,
|
|
378
|
+
"output_per_1m": 4
|
|
379
|
+
}
|
|
348
380
|
}
|
|
349
381
|
},
|
|
350
382
|
"context_management": {
|
|
@@ -31,6 +31,21 @@
|
|
|
31
31
|
"503": "overloaded"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
+
"availability": {
|
|
35
|
+
"required": false,
|
|
36
|
+
"regions": [
|
|
37
|
+
"global"
|
|
38
|
+
],
|
|
39
|
+
"check": {
|
|
40
|
+
"method": "GET",
|
|
41
|
+
"path": "/models",
|
|
42
|
+
"expected_status": [
|
|
43
|
+
200,
|
|
44
|
+
401
|
|
45
|
+
],
|
|
46
|
+
"timeout_ms": 3000
|
|
47
|
+
}
|
|
48
|
+
},
|
|
34
49
|
"capabilities": {
|
|
35
50
|
"required": [
|
|
36
51
|
"text",
|
|
@@ -44,6 +59,12 @@
|
|
|
44
59
|
"feature_flags": {
|
|
45
60
|
"structured_output": true,
|
|
46
61
|
"system_messages": true
|
|
62
|
+
},
|
|
63
|
+
"tool_calling": {
|
|
64
|
+
"native": {
|
|
65
|
+
"supported": true,
|
|
66
|
+
"reliability": "full"
|
|
67
|
+
}
|
|
47
68
|
}
|
|
48
69
|
},
|
|
49
70
|
"capability_profile": {
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"id": "deepseek",
|
|
4
4
|
"protocol_version": "2.0",
|
|
5
5
|
"name": "DeepSeek",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "4.0.0",
|
|
7
7
|
"status": "stable",
|
|
8
8
|
"category": "ai_provider",
|
|
9
9
|
"official_url": "https://api-docs.deepseek.com/",
|
|
10
10
|
"support_contact": "https://api-docs.deepseek.com/",
|
|
11
11
|
"endpoint": {
|
|
12
|
-
"base_url": "https://api.deepseek.com
|
|
12
|
+
"base_url": "https://api.deepseek.com",
|
|
13
13
|
"chat": "/chat/completions",
|
|
14
14
|
"auth": {
|
|
15
15
|
"type": "bearer",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"by_http_status": {
|
|
23
23
|
"400": "invalid_request",
|
|
24
24
|
"401": "authentication",
|
|
25
|
+
"402": "insufficient_quota",
|
|
25
26
|
"403": "permission_denied",
|
|
26
27
|
"404": "not_found",
|
|
27
28
|
"413": "request_too_large",
|
|
@@ -36,6 +37,22 @@
|
|
|
36
37
|
"insufficient_quota": "quota_exhausted"
|
|
37
38
|
}
|
|
38
39
|
},
|
|
40
|
+
"availability": {
|
|
41
|
+
"required": false,
|
|
42
|
+
"regions": [
|
|
43
|
+
"cn",
|
|
44
|
+
"global"
|
|
45
|
+
],
|
|
46
|
+
"check": {
|
|
47
|
+
"method": "GET",
|
|
48
|
+
"path": "/models",
|
|
49
|
+
"expected_status": [
|
|
50
|
+
200,
|
|
51
|
+
401
|
|
52
|
+
],
|
|
53
|
+
"timeout_ms": 3000
|
|
54
|
+
}
|
|
55
|
+
},
|
|
39
56
|
"capabilities": {
|
|
40
57
|
"required": [
|
|
41
58
|
"text",
|
|
@@ -43,7 +60,6 @@
|
|
|
43
60
|
"tools"
|
|
44
61
|
],
|
|
45
62
|
"optional": [
|
|
46
|
-
"vision",
|
|
47
63
|
"parallel_tools",
|
|
48
64
|
"agentic",
|
|
49
65
|
"reasoning",
|
|
@@ -56,6 +72,37 @@
|
|
|
56
72
|
"extended_thinking": true,
|
|
57
73
|
"streaming_usage": true,
|
|
58
74
|
"system_messages": true
|
|
75
|
+
},
|
|
76
|
+
"tool_calling": {
|
|
77
|
+
"native": {
|
|
78
|
+
"supported": true,
|
|
79
|
+
"reliability": "partial",
|
|
80
|
+
"parallel": true,
|
|
81
|
+
"streaming": true,
|
|
82
|
+
"notes": "DeepSeek native tool calling is unreliable — LLM often outputs <shell> instead; text fallback required"
|
|
83
|
+
},
|
|
84
|
+
"text_fallback": {
|
|
85
|
+
"format": "xml_json",
|
|
86
|
+
"wrapper": "tool_call",
|
|
87
|
+
"body": "json",
|
|
88
|
+
"name_location": "json_field",
|
|
89
|
+
"args_key": "arguments",
|
|
90
|
+
"known_dialects": [
|
|
91
|
+
{
|
|
92
|
+
"tag": "shell",
|
|
93
|
+
"map_to": "shell"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"tag": "bash",
|
|
97
|
+
"map_to": "shell"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"tag": "function",
|
|
101
|
+
"map_to": ""
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"prompt_level": "L2"
|
|
105
|
+
}
|
|
59
106
|
}
|
|
60
107
|
},
|
|
61
108
|
"capability_profile": {
|
|
@@ -74,8 +121,7 @@
|
|
|
74
121
|
},
|
|
75
122
|
"systems": {
|
|
76
123
|
"requires": [
|
|
77
|
-
"mcp"
|
|
78
|
-
"search"
|
|
124
|
+
"mcp"
|
|
79
125
|
]
|
|
80
126
|
}
|
|
81
127
|
},
|
|
@@ -116,16 +162,17 @@
|
|
|
116
162
|
},
|
|
117
163
|
"stream": {
|
|
118
164
|
"type": "boolean"
|
|
165
|
+
},
|
|
166
|
+
"reasoning_effort": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"enum": [
|
|
169
|
+
"low",
|
|
170
|
+
"medium",
|
|
171
|
+
"high"
|
|
172
|
+
],
|
|
173
|
+
"default": "medium"
|
|
119
174
|
}
|
|
120
175
|
},
|
|
121
|
-
"parameter_mappings": {
|
|
122
|
-
"temperature": "temperature",
|
|
123
|
-
"max_tokens": "max_tokens",
|
|
124
|
-
"stream": "stream",
|
|
125
|
-
"top_p": "top_p",
|
|
126
|
-
"tools": "tools",
|
|
127
|
-
"tool_choice": "tool_choice"
|
|
128
|
-
},
|
|
129
176
|
"streaming": {
|
|
130
177
|
"decoder": {
|
|
131
178
|
"format": "sse",
|
|
@@ -144,6 +191,13 @@
|
|
|
144
191
|
"content": "$.choices[*].delta.content"
|
|
145
192
|
}
|
|
146
193
|
},
|
|
194
|
+
{
|
|
195
|
+
"match": "exists($.choices[*].delta.reasoning_content)",
|
|
196
|
+
"emit": "ThinkingDelta",
|
|
197
|
+
"fields": {
|
|
198
|
+
"thinking": "$.choices[*].delta.reasoning_content"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
147
201
|
{
|
|
148
202
|
"match": "exists($.choices[*].delta.tool_calls)",
|
|
149
203
|
"emit": "PartialToolCall",
|
|
@@ -171,18 +225,7 @@
|
|
|
171
225
|
"multimodal": {
|
|
172
226
|
"input": {
|
|
173
227
|
"vision": {
|
|
174
|
-
"supported":
|
|
175
|
-
"formats": [
|
|
176
|
-
"jpeg",
|
|
177
|
-
"png",
|
|
178
|
-
"gif",
|
|
179
|
-
"webp"
|
|
180
|
-
],
|
|
181
|
-
"encoding_methods": [
|
|
182
|
-
"base64_inline",
|
|
183
|
-
"url"
|
|
184
|
-
],
|
|
185
|
-
"document_understanding": true
|
|
228
|
+
"supported": false
|
|
186
229
|
},
|
|
187
230
|
"audio": {
|
|
188
231
|
"supported": false
|
|
@@ -202,20 +245,26 @@
|
|
|
202
245
|
}
|
|
203
246
|
},
|
|
204
247
|
"api_families": [
|
|
205
|
-
"chat_completions"
|
|
248
|
+
"chat_completions",
|
|
249
|
+
"anthropic_messages"
|
|
206
250
|
],
|
|
207
251
|
"default_api_family": "chat_completions",
|
|
208
252
|
"endpoints": {
|
|
209
|
-
"
|
|
253
|
+
"chat_openai": {
|
|
210
254
|
"path": "/chat/completions",
|
|
211
255
|
"method": "POST",
|
|
212
256
|
"adapter": "openai"
|
|
257
|
+
},
|
|
258
|
+
"chat_anthropic": {
|
|
259
|
+
"path": "/anthropic/v1/messages",
|
|
260
|
+
"method": "POST",
|
|
261
|
+
"adapter": "anthropic"
|
|
213
262
|
}
|
|
214
263
|
},
|
|
215
264
|
"retry_policy": {
|
|
216
265
|
"strategy": "exponential_backoff",
|
|
217
266
|
"max_retries": 3,
|
|
218
|
-
"min_delay_ms":
|
|
267
|
+
"min_delay_ms": 500,
|
|
219
268
|
"max_delay_ms": 30000,
|
|
220
269
|
"jitter": "full",
|
|
221
270
|
"retry_on_http_status": [
|
|
@@ -234,37 +283,62 @@
|
|
|
234
283
|
}
|
|
235
284
|
},
|
|
236
285
|
"metadata": {
|
|
237
|
-
"api_compatibility":
|
|
286
|
+
"api_compatibility": [
|
|
287
|
+
"openai",
|
|
288
|
+
"anthropic"
|
|
289
|
+
],
|
|
238
290
|
"open_source": {
|
|
239
|
-
"license": "MIT",
|
|
240
|
-
"hugging_face": "https://huggingface.co/deepseek-ai/
|
|
291
|
+
"license": "MIT (weights)",
|
|
292
|
+
"hugging_face": "https://huggingface.co/collections/deepseek-ai/deepseek-v4"
|
|
241
293
|
},
|
|
242
294
|
"models": {
|
|
243
|
-
"deepseek-
|
|
244
|
-
"context_window":
|
|
245
|
-
"max_output_tokens":
|
|
295
|
+
"deepseek-v4-pro": {
|
|
296
|
+
"context_window": 1048576,
|
|
297
|
+
"max_output_tokens": 393216,
|
|
298
|
+
"release_date": "2026-04-24",
|
|
246
299
|
"architecture": {
|
|
247
300
|
"type": "moe",
|
|
248
|
-
"total": "
|
|
249
|
-
"active": "
|
|
250
|
-
"experts": 256
|
|
301
|
+
"total": "1.6T",
|
|
302
|
+
"active": "49B"
|
|
251
303
|
},
|
|
252
304
|
"pricing": {
|
|
253
|
-
"input_per_1m": 0.
|
|
254
|
-
"output_per_1m": 0.
|
|
255
|
-
|
|
305
|
+
"input_per_1m": 0.435,
|
|
306
|
+
"output_per_1m": 0.87,
|
|
307
|
+
"cache_hit_input_per_1m": 0.003625
|
|
308
|
+
},
|
|
309
|
+
"thinking": "dual_mode"
|
|
256
310
|
},
|
|
257
|
-
"deepseek-
|
|
258
|
-
"context_window":
|
|
259
|
-
"max_output_tokens":
|
|
311
|
+
"deepseek-v4-flash": {
|
|
312
|
+
"context_window": 1048576,
|
|
313
|
+
"max_output_tokens": 393216,
|
|
314
|
+
"release_date": "2026-04-24",
|
|
315
|
+
"architecture": {
|
|
316
|
+
"type": "moe",
|
|
317
|
+
"total": "284B",
|
|
318
|
+
"active": "13B"
|
|
319
|
+
},
|
|
260
320
|
"pricing": {
|
|
261
|
-
"input_per_1m": 0.
|
|
262
|
-
"output_per_1m":
|
|
263
|
-
|
|
321
|
+
"input_per_1m": 0.14,
|
|
322
|
+
"output_per_1m": 0.28,
|
|
323
|
+
"cache_hit_input_per_1m": 0.0028
|
|
324
|
+
},
|
|
325
|
+
"thinking": "dual_mode"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"deprecated": {
|
|
329
|
+
"deepseek-chat": {
|
|
330
|
+
"retired_on": "2026-07-24",
|
|
331
|
+
"maps_to": "deepseek-v4-flash (non-thinking)",
|
|
332
|
+
"note": "Use deepseek-v4-flash instead"
|
|
333
|
+
},
|
|
334
|
+
"deepseek-reasoner": {
|
|
335
|
+
"retired_on": "2026-07-24",
|
|
336
|
+
"maps_to": "deepseek-v4-flash (thinking mode)",
|
|
337
|
+
"note": "Use deepseek-v4-flash with thinking mode instead"
|
|
264
338
|
}
|
|
265
339
|
},
|
|
266
340
|
"sdk": {
|
|
267
|
-
"note": "OpenAI-compatible — use openai SDK with base_url override",
|
|
341
|
+
"note": "OpenAI-compatible — use openai SDK with base_url override. Also supports Anthropic Messages API format.",
|
|
268
342
|
"python": "openai",
|
|
269
343
|
"typescript": "openai"
|
|
270
344
|
}
|