---
title: "Run a CLI Agent Chat Completion"
method: POST
path: "/v2/cli-agent/completions"
tags: ["CLI Agent V2"]
---

# Run a CLI Agent Chat Completion

`POST /v2/cli-agent/completions`

## Request body

- object
  - `messages` object[], required — an array of at least 1 item(s)
    - `role` string, required
  - `max_tokens` number
  - `temperature` number
  - `top_p` number
  - `stop` union
    - string
    - string[]
  - `tools` unknown[]
    - unknown
  - `tool_choice` unknown
  - `response_format` unknown

## Response `200`

Success

- unknown

## Other responses

- `400` — The request did not match the expected schema
- `401` — No API key was provided in the request
- `402` — The user's hosted CLI AI credit has been exhausted. Fall back to running the prompt in a local agent.
- `429` — Too many requests have been made in a short period
- `500` — An unexpected error occurred on the server

---

[API](https://skmtc.dev/superwall/apis/superwall-api-v2.md) · [All operations](https://skmtc.dev/superwall/apis/superwall-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/superwall/superwall-api-v2/revisions/e04f76c478af/schema)
