---
title: "Create a legacy text completion"
method: POST
path: "/v1/completions"
tags: ["Completions"]
---

# Create a legacy text completion

`POST /v1/completions`

## Request

- Base URL: `https://app.getsupers.com`
- URL: `https://app.getsupers.com/v1/completions`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://app.getsupers.com/oauth/authorize`
    - Token URL: `https://app.getsupers.com/oauth/token` scopes: `api:completions`

Creates an OpenAI-compatible legacy prompt completion. New integrations should prefer /v1/chat/completions.

## Request body

- CompletionRequest
  - `model` string: A model ID returned by GET /v1/models.
  - `prompt` union, required
    - string
    - string[]
  - `system` string
  - `temperature` number
  - `max_tokens` integer
  - `stream` boolean
  - `cache` boolean

## Response `200`

Legacy completion result

- TextCompletion
  - `id` string, required
  - `object` 'text_completion', required
  - `created` integer, required
  - `model` string, required
  - `choices` TextChoice[], required
    - `index` integer, required
    - `text` string, required
    - `logprobs` object, nullable
    - `finish_reason` string, nullable
  - `usage` Usage
    - `prompt_tokens` integer
    - `completion_tokens` integer
    - `total_tokens` integer
  - `x_superpowers` SuperMetadata, required
    - `cache_hit` boolean, required
    - `cache_entry_id` string, nullable
    - `cache_store_status` string, nullable
    - `credits_used` number, required
    - `credits_remaining` number, required
    - `owner` string, required
    - `resolved_owner` string, nullable
    - `usage_estimated` boolean

## Other responses

- `400`: The request body is invalid or the model is unsupported.
- `401`: The API key is missing, invalid, revoked, or unauthorized.
- `402`: The account does not have enough credits for the completion.
- `403`: The authenticated credential does not carry the required named OAuth scope or API-key permission.
- `429`: The request rate is too high. Retry after the duration in Retry-After.
- `500`: The model provider or Super API could not complete the request.
- `502`: The model provider or Super API could not complete the request.
- `4XX`: A typed client error not covered by a more specific 4xx response.
- `5XX`: The model provider or Super API could not complete the request.

---

[API](https://skmtc.dev/agentsbase/apis/superpowers-ai-super-api.md) - [All operations](https://skmtc.dev/agentsbase/apis/superpowers-ai-super-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsbase/apis/superpowers-ai-super-api/revisions/863feb591af3?raw)
