Skip to main content
POST
Chat Completions

Overview

Quick Start

Send a request with model and messages. Use stream=true to receive SSE chunks.
Supported models: surf-ask, surf-research, surf-1.5, surf-1.5-instant, surf-1.5-thinking.
surf-ask and surf-research are legacy models. surf-1.5, surf-1.5-instant, and surf-1.5-thinking are the new models. Legacy models remain available and the request format is unchanged.
Note: When using surf-research and surf-1.5, it is recommended to set the timeout to 10 minutes.

What’s new in surf-1.5

surf-1.5 is the recommended, next-generation model. Compared to legacy models, it’s designed for more advanced workflows:
  • Enhanced performance: Delivers superior response quality with significantly reduced latency in surf-1.5-instant, providing faster and more accurate results compared to legacy models.
  • Custom tool calls (function calling): Better support for defining tools via tools and orchestrating multi-step tool-augmented tasks.
  • Configurable reasoning depth: Use reasoning_effort (low / medium / high) to trade off speed vs. deeper analysis.
  • Built for agent-style workflows: Works well with Surf extensions like ability (capability constraints) and citation (citation formats) in the same request shape.

Model variants: surf-1.5, surf-1.5-instant, surf-1.5-thinking

The surf-1.5 family includes three model variants with different reasoning capabilities:
  • surf-1.5-instant: A lightweight model optimized for fast responses to simple queries.
  • surf-1.5-thinking: A more powerful model with deeper reasoning capabilities, designed to handle complex problems that require thorough analysis and multi-step reasoning.
  • surf-1.5: An adaptive model that automatically selects between surf-1.5-instant and surf-1.5-thinking based on the request parameters and problem complexity. This provides an optimal balance between speed and depth without requiring manual model selection.

Summary (What you can do)

  • OpenAI-compatible: Use the OpenAI Chat Completions shape (model, messages, optional stream) and standard Authorization: Bearer <API_KEY>.
  • Streaming (SSE): Set stream=true to receive incremental chunks (text/event-stream) and terminate on data: [DONE].
  • Custom tool calls: Provide tools (OpenAI function calling). The model may request tool executions during generation.
  • Reasoning depth: Control analysis strength with reasoning_effort: low / medium / high.
  • Surf extensions: Use ability to constrain available capability domains and citation to request output citation formats.
  • Errors: This endpoint may return 400, 401, or 502 (both streaming and non-streaming).

Examples

Non-streaming response example (with field annotations)

Request fields (model.CompletionsRequest)

Note: This endpoint follows the overall structure of OpenAI chat.completions, and additionally provides Surf extension fields such as ability and citation.

Single message in messages[] (model.Message)

Tool definitions in tools[] (model.Tool / model.ToolFunction)

Fields of the function object:

Response fields (non-streaming JSON: model.CompletionsProxyResponse)

choices[] (model.CompletionsChoice)

message (model.CompletionsMessage)

usage (model.CompletionsUsage)

Streaming response (SSE: text/event-stream)

When stream=true, the server continuously streams SSE events. Each event block typically looks like:
The termination event is:
Note: The current OpenAPI spec does not define a dedicated schema for streaming chunks. In the examples, each chunk’s object is typically chat.completion.chunk, and incremental output is delivered via choices[].delta (e.g., role / content). finish_reason is usually null until the stream ends.

Error response (model.BaseResponse)

This endpoint may return: 400, 401, 502 (both streaming and non-streaming).

Authorizations

Authorization
string
header
required

Body

application/json

Request body (OpenAI-compatible)

ability
enum<string>[]
Available options:
search,
evm_onchain,
solana_onchain,
market_analysis,
calculate
Example:
citation
enum<string>[]
Available options:
source,
chart
Example:
messages
object[]
model
enum<string>
Available options:
surf-ask,
surf-research,
surf-1.5,
surf-1.5-thinking,
surf-1.5-instant
Example:

"surf-ask"

reasoning_effort
enum<string>
Available options:
low,
medium,
high
Example:

"medium"

stream
boolean
Example:

false

tools
object[]

Response

OK

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