Chat-Vervollständigungen
Basis-URL: https://app.neuroflash.com/api/ds-prototypes
Generiere Textvervollständigungen mit KI-Modellen
Chat-Vervollständigungen
POST
/chat/completionsVerarbeite Chat-Vervollständigungen mit Token-Verfolgung und Provider-Routing
Anfrage-Body
FeldTypErforderlichBeschreibung
messagesarray<object>JaListe von Nachrichten mit 'role' und 'content'modelstringJaName des ModellstemperatureobjectNeinTemperatur des Modellsmax_tokensobjectNeinBegrenzen Sie die Anzahl der zu generierenden TokenreasoningobjectNeinParameter für den Reasoning-Modusreasoning_effortobjectNeinStufe des Reasoning-ModustoolsobjectNeinFür Tools & Funktionsaufrufetool_choiceobjectNeinBeeinflussen Sie die Tool-AuswahlseedobjectNeinZufälliger Seedresponse_formatobjectNeinWird für strukturierte Ausgaben verwendet, um ein JSON-Schema zu definierenweb_search_optionsobjectNeinZusätzliche Optionen für WEB Searchstructured_outputsobjectNeinSchema, das die strukturierte Ausgabe beschreibt, die das Modell produzieren sollfrequency_penaltyobjectNeinBestrafungsoptionpresence_penaltyobjectNeinBestrafungsoptionrepetition_penaltyobjectNeinBestrafungsoptionstopobjectNeinStoppbedingung anpassenstreamobjectNeinStreaming-Modus aktivierenBeispiel
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/ds-prototypes/chat/completions" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"messages": [],
"model": "string",
"temperature": {},
"max_tokens": {},
"reasoning": {},
"reasoning_effort": {},
"tools": {},
"tool_choice": {},
"seed": {},
"response_format": {},
"web_search_options": {},
"structured_outputs": {},
"frequency_penalty": {},
"presence_penalty": {},
"repetition_penalty": {},
"stop": {},
"stream": {}
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/ds-prototypes/chat/completions",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id, "Content-Type": "application/json"},
json={
"messages": [],
"model": "string",
"temperature": {},
"max_tokens": {},
"reasoning": {},
"reasoning_effort": {},
"tools": {},
"tool_choice": {},
"seed": {},
"response_format": {},
"web_search_options": {},
"structured_outputs": {},
"frequency_penalty": {},
"presence_penalty": {},
"repetition_penalty": {},
"stop": {},
"stream": {}
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/chat/completions`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"x-workspace-id": workspaceId,
"Content-Type": "application/json",
},
body: JSON.stringify({
"messages": [],
"model": "string",
"temperature": {},
"max_tokens": {},
"reasoning": {},
"reasoning_effort": {},
"tools": {},
"tool_choice": {},
"seed": {},
"response_format": {},
"web_search_options": {},
"structured_outputs": {},
"frequency_penalty": {},
"presence_penalty": {},
"repetition_penalty": {},
"stop": {},
"stream": {}
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"messages": []any{},
"model": "string",
"temperature": map[string]any{},
"max_tokens": map[string]any{},
"reasoning": map[string]any{},
"reasoning_effort": map[string]any{},
"tools": map[string]any{},
"tool_choice": map[string]any{},
"seed": map[string]any{},
"response_format": map[string]any{},
"web_search_options": map[string]any{},
"structured_outputs": map[string]any{},
"frequency_penalty": map[string]any{},
"presence_penalty": map[string]any{},
"repetition_penalty": map[string]any{},
"stop": map[string]any{},
"stream": map[string]any{},
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/ds-prototypes/chat/completions", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{}
Systemzustandsprüfung
GET
/healthHealth-Check-Endpunkt
Beispiel
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/ds-prototypes/health" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/ds-prototypes/health",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/health`,
{ headers: { Authorization: `Bearer ${token}`, "x-workspace-id": workspaceId } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/ds-prototypes/health", nil)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{}