Chat API

OpenAI-compatible endpoint for chat completions.

Endpoint

POST https://neuralhub.xyz/v1/chat/completions

Request Body

The API accepts the standard OpenAI Chat Completion parameters.

ParameterTypeDescription
modelstringID of the model to use.
messagesarrayA list of messages comprising the conversation so far.
workspaceIdstringOptional. 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!"
      }
    ]
  }'
NeuralHub — Unified AI API Gateway