Skip to main content
POST
/
v1
/
chat
/
completions
Chat Completions
curl --request POST \
  --url https://api.asksurf.ai/surf-ai/v1/chat/completions \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "messages": [
    {
      "content": "Summarize today's Bitcoin market.",
      "role": "user"
    }
  ],
  "model": "surf-ask",
  "stream": false
}
EOF
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1699890366,
  "model": "surf-ask",
  "choices": [
    {
      "index": 0,
      "finish_reason": "stop",
      "message": {
        "role": "assistant",
        "content": "BTC is trading flat in the last 24h with rising open interest."
      }
    }
  ],
  "usage": {
    "prompt_tokens": 23,
    "completion_tokens": 12,
    "total_tokens": 35
  }
}

Authorizations

Authorization
string
header
required

Body

application/json

Request body (OpenAI-compatible)

messages
object[]
model
enum<string>
Available options:
surf-ask,
surf-research
Example:

"surf-ask"

stream
boolean
Example:

false

Response

Returns JSON when stream=false and SSE chunks when stream=true.

choices
object[]
created
integer

Timestamp indicating when the message was generated.

Example:

1764312947

id
string

A unique identifier for the generated message. Used for internal tracking.

Example:

"chatcmpl-1764312947577"

model
string
Example:

"surf-ask"

object
string
Example:

"chat.completion"

usage
object