Chat API
OpenAI-compatible endpoint for chat completions.
Endpoint
POST https://neuralhub.xyz/v1/chat/completionsRequest Body
The API accepts the standard OpenAI Chat Completion parameters.
| Parameter | Type | Description |
|---|---|---|
| model | string | ID of the model to use. |
| messages | array | A list of messages comprising the conversation so far. |
| workspaceId | string | Optional. UUID of the workspace to inject context from. |
Example
curl https://neuralhub.xyz/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NEURALHUB_API_KEY" \
-d '{
"model": "google/gemini-2.0-flash-001",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}'