---
title: "LLM"
method: POST
path: "/api/generate/llm"
tags: ["generate"]
---

# LLM

`POST /api/generate/llm`

Generate text using a language model.

## Response `200`

Successful Response

- LLMResponse
  - `response` string, required
  - `tokens_used` integer, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `422` — Validation Error
- `500` — Internal Server Error
- `default` — Error

## Changes

- **2024-10-07** `d5fb95912501` — 2 info
  - the request property `model_id` became optional
  - the `model_id` request property default value changed from `` to `meta-llama/Meta-Llama-3.1-8B-Instruct`
- **2024-10-03** `cbf999b9a7cf` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/livepeer/apis/untitled-api/changes/api/generate/llm/post.md)

---

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