Skip to main content
POST
/
completions
Completions
curl --request POST \
  --url https://api.example.com/completions
This endpoint is legacy. Use Chat Completions or Responses for new applications.

Endpoint

POST https://inference.phala.com/v1/completions

Request

{
  "model": "gpt-3.5-turbo-instruct",
  "prompt": "Say this is a test",
  "max_tokens": 7,
  "temperature": 0
}

Response

{
  "id": "cmpl-123",
  "object": "text_completion",
  "created": 1677652288,
  "model": "gpt-3.5-turbo-instruct",
  "choices": [
    {
      "text": "\n\nThis is a test.",
      "index": 0,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 5,
    "completion_tokens": 7,
    "total_tokens": 12
  }
}
Like other inference endpoints, raw HTTP responses include x-receipt-id for verification.

Chat Completions

Get Receipt