cURL
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
200
json
{ "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 } }
OpenAI-compatible Chat Completions. Use Bearer authorization. When stream=true, responds as Server-Sent Events (SSE); otherwise returns JSON.
Request body (OpenAI-compatible)
Show child attributes
surf-ask
surf-research
"surf-ask"
false
Returns JSON when stream=false and SSE chunks when stream=true.
Timestamp indicating when the message was generated.
1764312947
A unique identifier for the generated message. Used for internal tracking.
"chatcmpl-1764312947577"
"chat.completion"