Skip to main content
POST
Create a text completion

Authorizations

Authorization
string
header
required

The workspace API key (pdk_…) from Integrations → Built-in in the pre.dev dashboard.

Headers

x-predev-project-id
string

Attribute this call to one of the workspace's projects. An id the workspace does not own is ignored.

Body

application/json
model
string
required
Example:

"deepseek/deepseek-v4.1-flash"

prompt
required
max_tokens
integer
Required range: x >= 1
temperature
number
stop
stream
boolean
default:false

Response

The completion, or server-sent chunks when stream is true.

id
string
required

Generation id (pdg-…).

model
string
required
choices
object[]
required
object
string
Allowed value: "text_completion"
created
integer
usage
object

Token counts for the call. Charges are reported in credits by the x-predev-credits-charged header and GET /v1/generation.