POST /v1/chat/completions

POST/v1/chat/completions

OpenAI-compatible Chat Completions. Use Bearer authorization. Proxied to hermod for authentication, billing, and LLM execution.

Query Parameters

abilitystring[]
citationstring[]
messagesobject[]
modelobject
reasoning_effortobject
streamboolean
toolsobject[]
POST /v1/chat/completions
const options = {method: 'POST'};

fetch('https://api.asksurf.ai/surf-ai/v1/chat/completions', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
OK
{
  "choices": [
    {
      "finish_reason": "<string>",
      "index": 123,
      "message": {
        "content": "<string>",
        "reasoning": "<string>",
        "role": {}
      }
    }
  ],
  "created": 123,
  "id": "<string>",
  "model": "<string>",
  "object": "<string>",
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}