---
title: "Terminal Completion"
method: POST
path: "/v1/terminal/completion"
tags: ["terminal"]
---

# Terminal Completion

`POST /v1/terminal/completion`

## Request body

- TerminalCompletionRequest
  - `instruction` string, required — Natural language instruction describing what to do in terminal
  - `model` string, nullable
  - `context` object, nullable — Additional context like OS, shell, working directory

## Response `200`

Successful Response

- TerminalCompletionResponse
  - `commands` TerminalCommand[], required
    - `command` string, required — The bash command to execute
    - `explanation` string, required — Brief explanation of what the command does
    - `safety_warning` string, nullable — Warning if command is potentially dangerous
  - `type` string
  - `metadata` TerminalCompletionMetadata, required
    - `model` string, required
    - `tokensUsed` integer, required
    - `latencyMs` integer, required

## Other responses

- `422` — Validation Error

---

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