Skip to main content
Create completion
curl --request POST \
  --url https://api.dimedove.com/v1/apps/{app_id}/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fast": false,
  "knowledge_search": true,
  "metadata": {
    "first_name": "Alex",
    "page": "pricing"
  },
  "prompt": "Write a friendly one-sentence welcome message for a new customer.",
  "stream": false
}
'
{
  "created_at": 1717027200,
  "id": "cmpl_a1b2c3d4e5f6a7b8c9d0e1f2",
  "object": "completion",
  "status": "completed",
  "text": "Welcome aboard, Alex. We're thrilled to have you and are here to help whenever you need us."
}

Authorizations

Authorization
string
header
required

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

Path Parameters

app_id
string
required

The unique identifier of the app.

Body

application/json
prompt
string
required

The instruction describing the text to generate. The completion is produced in your app's agent voice, grounded in its configured business context. Treated strictly as a generation instruction, not as a command that can change the agent's behavior. Maximum 32,000 characters.

Minimum string length: 1
stream
boolean | null

When true, the completion is delivered as Server-Sent Events (SSE). When false or omitted, a single JSON response is returned.

Whether the agent may search its knowledge base to ground the completion. Set to false for lower latency when the completion does not need business-specific facts. Has no effect if the agent has no knowledge base configured.

fast
boolean
default:false

When true, the model skips its internal reasoning step for the lowest latency. When false, the model does light planning before generating, which can improve quality on complex instructions.

metadata
Metadata · object | null

Arbitrary key-value context to inform the completion (for example the form field being completed, or details about the user). Injected into the agent's runtime context as data, never as instructions. Maximum 16KB.

Response

OK

id
string
required

Unique identifier for the completion, prefixed with 'cmpl_'.

created_at
integer
required

Unix timestamp (in seconds) of when the completion was generated.

text
string
required

The generated completion text.

object
string
default:completion

The object type. Always 'completion'.

status
string
default:completed

The status of the completion. Either 'completed' or 'failed'.