Doubao Seed 2.0 Schnell-Chat
curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seed-2.0-pro",
"messages": [
{
"content": "<string>"
}
],
"stream": false
}
'import requests
url = "https://direct.evolink.ai/v1/chat/completions"
payload = {
"model": "doubao-seed-2.0-pro",
"messages": [{ "content": "<string>" }],
"stream": False
}
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: 'doubao-seed-2.0-pro', messages: [{content: '<string>'}], stream: false})
};
fetch('https://direct.evolink.ai/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://direct.evolink.ai/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' => 'doubao-seed-2.0-pro',
'messages' => [
[
'content' => '<string>'
]
],
'stream' => false
]),
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://direct.evolink.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"doubao-seed-2.0-pro\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"stream\": false\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://direct.evolink.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seed-2.0-pro\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/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\": \"doubao-seed-2.0-pro\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "server_error"
}
}Chat Completions API
Doubao Seed 2.0 - Schnellstart
- Doubao Seed 2.0 Modelle im OpenAI-SDK-Format aufrufen
- Synchroner Verarbeitungsmodus, Echtzeit-Antwort
- Minimale Parameter, schneller Einstieg
- Unterstuetzte Modelle:
doubao-seed-2.0-pro,doubao-seed-2.0-lite,doubao-seed-2.0-mini,doubao-seed-2.0-code - Mehr Funktionen benoetigt? Siehe Vollstaendige API-Referenz
POST
/
v1
/
chat
/
completions
Doubao Seed 2.0 Schnell-Chat
curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seed-2.0-pro",
"messages": [
{
"content": "<string>"
}
],
"stream": false
}
'import requests
url = "https://direct.evolink.ai/v1/chat/completions"
payload = {
"model": "doubao-seed-2.0-pro",
"messages": [{ "content": "<string>" }],
"stream": False
}
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: 'doubao-seed-2.0-pro', messages: [{content: '<string>'}], stream: false})
};
fetch('https://direct.evolink.ai/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://direct.evolink.ai/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' => 'doubao-seed-2.0-pro',
'messages' => [
[
'content' => '<string>'
]
],
'stream' => false
]),
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://direct.evolink.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"doubao-seed-2.0-pro\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"stream\": false\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://direct.evolink.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seed-2.0-pro\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/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\": \"doubao-seed-2.0-pro\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "server_error"
}
}BaseURL: Die Standard-BaseURL ist
https://direct.evolink.ai und bietet bessere Unterstützung für Textmodelle sowie persistente Verbindungen. https://api.evolink.ai ist der primäre Endpunkt für multimodale Dienste und dient bei Textmodellen als Ausweichadresse.Autorisierungen
##Alle APIs erfordern Bearer-Token-Authentifizierung##
API-Schluessel erhalten:
Besuchen Sie die API-Schluesselverwaltungsseite, um Ihren API-Schluessel zu erhalten
Zum Anfrage-Header hinzufuegen:
Authorization: Bearer YOUR_API_KEY
Body
application/json
Modell-ID
Verfügbare Optionen:
doubao-seed-2.0-pro, doubao-seed-2.0-lite, doubao-seed-2.0-mini, doubao-seed-2.0-code Nachrichtenliste
Show child attributes
Show child attributes
Ob Streaming-Ausgabe aktiviert werden soll
Antwort
Chat-Generierung erfolgreich