Chat Completions
Base URL: https://app.neuroflash.com/api/ds-prototypes
Generate text completions using AI models.
Chat Completions
POST
/chat/completionsHandle chat completions with token tracking and provider routing
Request Body
FieldTypeRequiredDescription
messagesarray<object>YesList of messages with 'role' and 'content'modelstringYesName of the modeltemperatureobjectNoTemperature of the modelmax_tokensobjectNoLimit the number of tokens to generatereasoningobjectNoParameters for the reasoning modereasoning_effortobjectNoLevel of the reasoning modetoolsobjectNoFor tools & function callingtool_choiceobjectNoInfluence tool selectionseedobjectNoRandom seedresponse_formatobjectNoUsed for structured outputs to define a JSON schemaweb_search_optionsobjectNoExtra options for WEB Searchstructured_outputsobjectNoSchema describing the structured output the model should producefrequency_penaltyobjectNoPenalizing optionpresence_penaltyobjectNoPenalizing optionrepetition_penaltyobjectNoPenalizing optionstopobjectNoCustomize stop conditionstreamobjectNoEnable streaming modeExample
- 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()
Response:
{}
Health Check
GET
/healthHealth check endpoint
Example
- 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()
Response:
{}