Create Completion (OpenAI Completions API Compatible)

OpenAI Completions API compatible endpoint. Creates a research job and returns the result in OpenAI text completion format. Supports both streaming and non-streaming responses. **Note:** This endpoint does not support file attachments. Files are only supported on `/compat/chat/completions`. To include files in your research, use the Chat Completions endpoint with multimodal content parts.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
modelstringRequired

Model identifier (accepted for compatibility).

promptstringRequired
The prompt to generate completions for.
max_tokensintegerOptional>=1

Maximum number of tokens to generate (accepted for compatibility).

temperaturedoubleOptional0-2Defaults to 1

Sampling temperature (accepted for compatibility).

top_pdoubleOptional0-1Defaults to 1

Nucleus sampling parameter (accepted for compatibility).

stopstring or list of stringsOptional

Sequences where the API will stop generating (accepted for compatibility).

seedintegerOptional

Random seed for deterministic sampling (accepted for compatibility).

streambooleanOptionalDefaults to false
Whether to stream partial progress via SSE.
stream_optionsobjectOptional
metadataobjectOptional
Research configuration parameters. When not provided, auto mode is used to determine optimal settings.

Response

Completion response (or SSE stream if stream=true).

idstring
Unique identifier for the completion.
objectenum
Object type.
Allowed values:
createdinteger
Unix timestamp of when the completion was created.
modelstring
Model used for the completion.
choiceslist of objects
List of completion choices.
usageobject

Errors