---
title: "cURL Examples"
description: "Using Liutong directly with cURL"
---

You can use Liutong directly with cURL or any HTTP client. No SDK required.

## Chat completion

```bash
curl https://api.liutong.llby.org/v1/chat/completions \
  -H "Authorization: Bearer lt_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "crimson-falcon-4",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is the capital of Japan?"}
    ],
    "temperature": 0.7,
    "max_tokens": 256
  }'
```

## Streaming

```bash
curl https://api.liutong.llby.org/v1/chat/completions \
  -H "Authorization: Bearer lt_your_api_key" \
  -H "Content-Type: application/json" \
  -N \
  -d '{
    "model": "crimson-falcon-4",
    "messages": [{"role": "user", "content": "Count from 1 to 10 slowly."}],
    "stream": true
  }'
```

The `-N` flag disables output buffering so you see tokens as they arrive.

## Reasoning

```bash
curl https://api.liutong.llby.org/v1/chat/completions \
  -H "Authorization: Bearer lt_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "indigo-owl-4",
    "messages": [
      {"role": "user", "content": "Prove that there are infinitely many prime numbers."}
    ]
  }'
```

## Embeddings

```bash
curl https://api.liutong.llby.org/v1/embeddings \
  -H "Authorization: Bearer lt_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jade-mole-4",
    "input": "Liutong makes inference affordable."
  }'
```

## Batch embeddings

```bash
curl https://api.liutong.llby.org/v1/embeddings \
  -H "Authorization: Bearer lt_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jade-mole-4",
    "input": ["First text.", "Second text.", "Third text."]
  }'
```

## List models

```bash
curl https://api.liutong.llby.org/v1/models \
  -H "Authorization: Bearer lt_your_api_key"
```
