> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vlm.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Completion

> Cost, usage, and serving details for a prior completion

Looks up a prior [chat completion](/gateway/api-reference/post-chat-completions) or [transcription](/gateway/api-reference/post-audio-transcriptions) by its `id`. The reply is metadata only: model, backend, cost, and usage. It never holds the request or the reply content.

Send the same `Authorization` header that made the call. The lookup spends one call from your [rate-limit](/gateway/rate-limits) budget. The MCP [`get_completion`](/gateway/mcp-reference#get_completion) tool reads the same records.

| Caller | Record kept for | Readable by |
| - | - | - |
| API key | Durably, in billing | The same user or organization |
| Anonymous | Up to about 15 minutes | The same `Authorization` value, or no header if the call sent none |

```python Python theme={"theme":{"light":"github-light","dark":"dark-plus"}}
import httpx
from openai import OpenAI

client = OpenAI(api_key="<VLMRUN_API_KEY>", base_url="https://gateway.vlm.run/v1/openai")
completion = client.chat.completions.create(
    model="qwen/qwen3.5-0.8b",
    messages=[{"role": "user", "content": "Say hi"}],
    max_tokens=8,
)

response = httpx.get(
    f"https://gateway.vlm.run/v1/completions/{completion.id}",
    headers={"Authorization": "Bearer <VLMRUN_API_KEY>"},
)
print(response.json())
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"dark-plus"}}
const completionId = "chatcmpl-d2765c665a9446b6aff13b71f1f";

const response = await fetch(`https://gateway.vlm.run/v1/completions/${completionId}`, {
  headers: { Authorization: `Bearer ${process.env.VLMRUN_API_KEY}` },
});
console.log(await response.json());
```

```bash cURL theme={"theme":{"light":"github-light","dark":"dark-plus"}}
curl https://gateway.vlm.run/v1/completions/chatcmpl-d2765c665a9446b6aff13b71f1f \
  -H "Authorization: Bearer $VLMRUN_API_KEY"
```

```json 200 theme={"theme":{"light":"github-light","dark":"dark-plus"}}
{
  "id": "chatcmpl-d2765c665a9446b6aff13b71f1f",
  "model": "qwen/qwen3.5-0.8b",
  "served_model_id": "qwen/qwen3.5-0.8b",
  "backend": "vllm",
  "cost": 0.001,
  "usage": {
    "prompt_tokens": 14,
    "total_tokens": 22,
    "completion_tokens": 8,
    "cost": 0.001
  },
  "status": null,
  "latency_ms": null
}
```

```json 404 theme={"theme":{"light":"github-light","dark":"dark-plus"}}
{
  "detail": {
    "error": {
      "message": "Completion 'chatcmpl-doesnotexist' not found.",
      "type": "completion_not_found",
      "code": null,
      "param": null
    }
  }
}
```

## Response

| Field | Type | Description |
| - | - | - |
| `id` | `string` | The completion id: `chatcmpl-…` for chat, `transcription-…` for transcription. |
| `model` | `string` | The model id the response reported. |
| `served_model_id` | `string` | The canonical model id. |
| `backend` | `string` | The inference runtime, such as `vllm` or `paddleocr`. |
| `cost` | `number` \| `null` | The charge in USD. `null` when the call was not priced. |
| `usage` | `object` | `prompt_tokens`, `completion_tokens`, `total_tokens`, and `cost` for chat. `input_tokens`, `output_tokens`, `total_tokens`, `input_audio_seconds`, and `cost` for transcription. |
| `status` | `string` \| `null` | The billing status, `completed` or `failed`. |
| `latency_ms` | `number` \| `null` | End-to-end latency in milliseconds. |

`status` and `latency_ms` come from the billing record. A lookup answered from the short-lived cache returns them as `null`.

## Errors

| Status | `type` | When |
| - | - | - |
| `404` | `completion_not_found` | The id is unknown, expired, or belongs to another caller. A retry of the original call mints a new id. It does not resolve the missed one. |
| `401` | n/a | The API key is invalid. |
| `429` | `rate_limit_exceeded` | The rate-limit budget is spent. |

See [Error Codes](/gateway/error-codes) for the Gateway-wide envelope.


## OpenAPI

````yaml https://gateway.vlm.run/openapi.json GET /v1/completions/{completion_id}
openapi: 3.1.0
info:
  title: VLM Run Gateway API
  summary: Unified gateway for computer-vision workloads.
  description: |
    The **VLM Run Gateway API** is the public entry point to the VLM Run
    inference platform. It fronts vision-language and computer-vision models
    behind a single OpenAI-compatible surface plus first-class real-time
    transports.

    [Documentation](https://docs.vlm.run) |
    [Terms of service](https://vlm.run/terms-of-service) |
    [Privacy policy](https://vlm.run/privacy) |
    [VLM Run](https://vlm.run) |
    [Send email to support@vlm.run](mailto:support@vlm.run)
  termsOfService: https://vlm.run/terms-of-service
  contact:
    name: VLM Run
    url: https://vlm.run/gateway
    email: support@vlm.run
  version: 0.50.0
servers:
  - url: https://gateway.vlm.run
    description: Production
  - url: http://localhost:8001
    description: Local development
security: []
paths:
  /v1/completions/{completion_id}:
    get:
      tags:
        - Completions
      summary: Read Completion
      operationId: read_completion_v1_completions__completion_id__get
      parameters:
        - name: completion_id
          in: path
          required: true
          schema:
            type: string
            title: Completion Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompletionInfo'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - _PermissiveHTTPBearer: []
components:
  schemas:
    CompletionInfo:
      properties:
        id:
          type: string
          title: Id
          description: The completion id (``chatcmpl-…`` or ``transcription-…``).
        model:
          type: string
          title: Model
          description: The model id echoed on the response.
        served_model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Served Model Id
          description: Canonical model id.
        backend:
          anyOf:
            - type: string
            - type: 'null'
          title: Backend
          description: Inference runtime for the request (vllm, paddleocr, …).
        cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost
          description: >-
            Metered cost of the request in US dollars, or null when the request
            was not priced.
        usage:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Usage
          description: >-
            Usage block: prompt/completion/total tokens for chat, or
            input_tokens/output_tokens/input_audio_seconds for transcription.
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Billing status (completed / failed).
        latency_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Latency Ms
          description: End-to-end latency in milliseconds.
      type: object
      required:
        - id
        - model
      title: CompletionInfo
      description: Cost, token usage, and serving metadata for one gateway generation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    _PermissiveHTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.