curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-4.6",
"input": "Search the web for the latest SpaceX launch and summarize it in one sentence.",
"stream": false,
"max_output_tokens": 2048,
"reasoning": {
"effort": "high"
},
"tools": [
{
"type": "web_search"
}
]
}
'import requests
url = "https://direct.evolink.ai/v1/responses"
payload = {
"model": "grok-4.6",
"input": "Search the web for the latest SpaceX launch and summarize it in one sentence.",
"stream": False,
"max_output_tokens": 2048,
"reasoning": { "effort": "high" },
"tools": [{ "type": "web_search" }]
}
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: 'grok-4.6',
input: 'Search the web for the latest SpaceX launch and summarize it in one sentence.',
stream: false,
max_output_tokens: 2048,
reasoning: {effort: 'high'},
tools: [{type: 'web_search'}]
})
};
fetch('https://direct.evolink.ai/v1/responses', 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/responses",
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' => 'grok-4.6',
'input' => 'Search the web for the latest SpaceX launch and summarize it in one sentence.',
'stream' => false,
'max_output_tokens' => 2048,
'reasoning' => [
'effort' => 'high'
],
'tools' => [
[
'type' => 'web_search'
]
]
]),
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/responses"
payload := strings.NewReader("{\n \"model\": \"grok-4.6\",\n \"input\": \"Search the web for the latest SpaceX launch and summarize it in one sentence.\",\n \"stream\": false,\n \"max_output_tokens\": 2048,\n \"reasoning\": {\n \"effort\": \"high\"\n },\n \"tools\": [\n {\n \"type\": \"web_search\"\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://direct.evolink.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"grok-4.6\",\n \"input\": \"Search the web for the latest SpaceX launch and summarize it in one sentence.\",\n \"stream\": false,\n \"max_output_tokens\": 2048,\n \"reasoning\": {\n \"effort\": \"high\"\n },\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/v1/responses")
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\": \"grok-4.6\",\n \"input\": \"Search the web for the latest SpaceX launch and summarize it in one sentence.\",\n \"stream\": false,\n \"max_output_tokens\": 2048,\n \"reasoning\": {\n \"effort\": \"high\"\n },\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "55d44212-8d5e-90cc-975f-36d341ce21f5",
"object": "response",
"status": "completed",
"model": "grok-4.6",
"created_at": 1786538000,
"output": [
{
"id": "<string>",
"type": "web_search_call",
"status": "completed",
"content": [
{}
]
}
],
"usage": {
"input_tokens": 10329,
"output_tokens": 299,
"total_tokens": 10628,
"input_tokens_details": {
"cached_tokens": 6016
},
"output_tokens_details": {
"reasoning_tokens": 128
},
"num_server_side_tools_used": 2,
"server_side_tool_usage_details": {
"web_search_calls": 2,
"x_search_calls": 0,
"code_interpreter_calls": 0,
"document_search_calls": 0,
"file_search_calls": 0,
"mcp_calls": 0
}
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/billing"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}Grok Schnittstelle für alle Modelle - Responses vollständige Parameter
- OpenAI-kompatibler Responses-Endpunkt für xAI-Grok-Textmodelle; Modellauswahl über den Parameter
model(alle Werte siehe Tabelle beim Parametermodel) - Kontextfenster von 500K Token; ab 200K Token im Prompt werden alle Token-Typen zum doppelten Preis abgerechnet
- Prompt-Caching greift automatisch: Token aus dem Cache werden zum günstigeren Cache-Eingabepreis abgerechnet
- Synchroner und Streaming-Modus (SSE)
- Serverseitige xAI-Tools laufen auf der xAI-Infrastruktur und werden pro erfolgreichem Aufruf abgerechnet:
web_search,x_search,code_execution,attachment_search,collections_search - Reguläre
function-Tools (clientseitige Funktionsaufrufe) werden ebenfalls unterstützt und verursachen keine Gebühr pro Aufruf
curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-4.6",
"input": "Search the web for the latest SpaceX launch and summarize it in one sentence.",
"stream": false,
"max_output_tokens": 2048,
"reasoning": {
"effort": "high"
},
"tools": [
{
"type": "web_search"
}
]
}
'import requests
url = "https://direct.evolink.ai/v1/responses"
payload = {
"model": "grok-4.6",
"input": "Search the web for the latest SpaceX launch and summarize it in one sentence.",
"stream": False,
"max_output_tokens": 2048,
"reasoning": { "effort": "high" },
"tools": [{ "type": "web_search" }]
}
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: 'grok-4.6',
input: 'Search the web for the latest SpaceX launch and summarize it in one sentence.',
stream: false,
max_output_tokens: 2048,
reasoning: {effort: 'high'},
tools: [{type: 'web_search'}]
})
};
fetch('https://direct.evolink.ai/v1/responses', 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/responses",
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' => 'grok-4.6',
'input' => 'Search the web for the latest SpaceX launch and summarize it in one sentence.',
'stream' => false,
'max_output_tokens' => 2048,
'reasoning' => [
'effort' => 'high'
],
'tools' => [
[
'type' => 'web_search'
]
]
]),
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/responses"
payload := strings.NewReader("{\n \"model\": \"grok-4.6\",\n \"input\": \"Search the web for the latest SpaceX launch and summarize it in one sentence.\",\n \"stream\": false,\n \"max_output_tokens\": 2048,\n \"reasoning\": {\n \"effort\": \"high\"\n },\n \"tools\": [\n {\n \"type\": \"web_search\"\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://direct.evolink.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"grok-4.6\",\n \"input\": \"Search the web for the latest SpaceX launch and summarize it in one sentence.\",\n \"stream\": false,\n \"max_output_tokens\": 2048,\n \"reasoning\": {\n \"effort\": \"high\"\n },\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/v1/responses")
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\": \"grok-4.6\",\n \"input\": \"Search the web for the latest SpaceX launch and summarize it in one sentence.\",\n \"stream\": false,\n \"max_output_tokens\": 2048,\n \"reasoning\": {\n \"effort\": \"high\"\n },\n \"tools\": [\n {\n \"type\": \"web_search\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "55d44212-8d5e-90cc-975f-36d341ce21f5",
"object": "response",
"status": "completed",
"model": "grok-4.6",
"created_at": 1786538000,
"output": [
{
"id": "<string>",
"type": "web_search_call",
"status": "completed",
"content": [
{}
]
}
],
"usage": {
"input_tokens": 10329,
"output_tokens": 299,
"total_tokens": 10628,
"input_tokens_details": {
"cached_tokens": 6016
},
"output_tokens_details": {
"reasoning_tokens": 128
},
"num_server_side_tools_used": 2,
"server_side_tool_usage_details": {
"web_search_calls": 2,
"x_search_calls": 0,
"code_interpreter_calls": 0,
"document_search_calls": 0,
"file_search_calls": 0,
"mcp_calls": 0
}
}
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/billing"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}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.image_generation ist derzeit weder auf Grok 4.5 noch auf Grok 4.6 verfügbar: Die Deklaration wird aus Kompatibilitätsgründen akzeptiert, das Tool aber entfernt, bevor die Anfrage das Modell erreicht. Nicht erkannte tools[].type-Werte werden mit 400 abgelehnt.Autorisierungen
##Alle APIs erfordern Bearer-Token-Authentifizierung##
API-Schlüssel erhalten:
Besuchen Sie die API-Schlüsselverwaltungsseite, um Ihren API-Schlüssel zu erhalten
Zum Anfrage-Header hinzufügen:
Authorization: Bearer YOUR_API_KEY
Body
Aufzurufendes Modell:
| Modell-ID | Positionierung |
|---|---|
grok-4.6 | xAI-Modell für Reasoning und Tool-Aufrufe, Kontextfenster von 500K; zusätzlich mit Reasoning-Stufe xhigh; Wissensstand 2026-02-01 |
grok-4.5 | xAI-Modell für Reasoning und Tool-Aufrufe, Kontextfenster von 500K; Reasoning-Stufen bis high (xhigh wird akzeptiert, aber auf high herabgestuft) |
grok-4.6, grok-4.5 "grok-4.6"
Eingabe für das Modell: eine einfache Zeichenkette oder ein Array von OpenAI-Responses-Eingabeelementen (z. B. {"role":"user","content":[...]}).
"Search the web for the latest SpaceX launch and summarize it in one sentence."
Ob eine Streaming-Antwort zurückgegeben wird (SSE-Events, endend mit response.completed). Standard false.
false
Maximale Anzahl der zu generierenden Token (einschließlich Reasoning-Token).
2048
Steuerung der Reasoning-Tiefe, Objektform: {"effort": "low" | "medium" | "high" | "xhigh"}. Standard ist high; Reasoning lässt sich nicht abschalten. xhigh wird nur von grok-4.6 unterstützt – grok-4.5 akzeptiert den Wert, stuft ihn aber auf high herab. Reasoning-Tokens werden als Ausgabe-Tokens abgerechnet und in usage.output_tokens_details.reasoning_tokens ausgewiesen.
Show child attributes
Show child attributes
Tool-Deklarationen. Serverseitige xAI-Tools (Abrechnung pro erfolgreichem Aufruf, Gebühren sind vom Long-Context-Multiplikator nicht betroffen):
| Tool-Typ | Funktion | Preis pro Aufruf |
|---|---|---|
web_search | Im Internet suchen und Webseiten aufrufen | $0.005 |
x_search | Beiträge, Profile und Threads auf X durchsuchen | $0.005 |
code_execution | Python in einer Sandbox ausführen (code_interpreter wird als Alias akzeptiert) | $0.005 |
attachment_search | An die Konversation angehängte Dateien durchsuchen (wird ggf. automatisch aktiviert, wenn die Eingabe Dateien enthält) | $0.01 |
collections_search | Hochgeladene Dokumentsammlungen abfragen (file_search wird als Alias akzeptiert) | $0.0025 |
Reguläre function-Tools (clientseitige Funktionsaufrufe) werden ebenfalls unterstützt und verursachen keine Gebühr pro Aufruf.
image_generation ist derzeit nicht verfügbar: Die Deklaration wird aus Kompatibilitätsgründen akzeptiert, das Tool aber entfernt, bevor die Anfrage das Modell erreicht. Nicht erkannte Tool-Typen werden mit 400 abgelehnt.
Show child attributes
Show child attributes
[{ "type": "web_search" }]
Steuert die Tool-Auswahl: "auto" (Standard) / "none" / "required" oder ein Objekt, das ein bestimmtes Tool festlegt, z. B. {"type": "web_search"}.
auto, none, required Antwort
Antwortgenerierung erfolgreich (JSON-Objekt oder – bei stream=true – ein SSE-Event-Stream, der mit response.completed endet)
Eindeutiger Bezeichner der Antwort
"55d44212-8d5e-90cc-975f-36d341ce21f5"
Antworttyp
response "response"
Antwortstatus
completed, incomplete, failed "completed"
Tatsächlich verwendeter Modellname
"grok-4.6"
Erstellungszeitstempel
1786538000
Ausgabeelemente in Generierungsreihenfolge: reasoning-Elemente (zusammengefasster Denkprozess), Elemente serverseitiger Tool-Aufrufe wie web_search_call / code_interpreter_call (der Status completed kennzeichnet einen erfolgreichen, abrechenbaren Aufruf) und abschließend ein message-Element mit output_text-Inhalt.
Show child attributes
Show child attributes
Statistik zur Token- und Tool-Nutzung. Ab 200K Token im Prompt werden alle Token-Typen zum doppelten Preis abgerechnet; Tool-Gebühren sind vom Multiplikator nicht betroffen.
Show child attributes
Show child attributes