Novisurf is fully OpenAI-compatible. If you’re already using the OpenAI SDK, just swap the base URL and API key — nothing else changes.
Endpoint
Authentication
Novisurf supports two ways to authenticate: X-API-Key headerRequest
Headers
| Header | Value |
|---|---|
Content-Type | application/json |
Authorization Bearer | Your API key (lsk_...) |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model to use. Check models in your console. |
messages | array | Yes | Conversation history as an array of message objects. |
stream | boolean | Optional | Stream the response via SSE. Defaults to false. |
temperature | number | Optional | Sampling temperature between 0 and 2. Defaults to 1.0. |
max_tokens | integer | Optional | Maximum tokens to generate. |
top_p | number | Optional | Nucleus sampling threshold between 0 and 1. Defaults to 1.0. |
stop | string or array | Optional | Up to 4 stop sequences. |
Message Object
| Field | Type | Description |
|---|---|---|
role | string | One of system, user, or assistant. |
content | string | The message content. |
Examples
Basic
Streaming
OpenAI SDK (drop-in)
Python (OpenAI SDK)
Response
Non-Streaming
Streaming
Streamed responses are sent as SSE events and terminated withdata: [DONE].
Error Codes
| Status | Meaning |
|---|---|
400 | Bad request — missing or invalid parameters |
401 | Unauthorized — invalid or missing API key |
402 | Insufficient credits |
429 | Rate limit exceeded |
500 | Internal server error |

