# Curl Examples

Set base:

```bash
BASE=http://127.0.0.1:11435
```

## Health

```bash
curl -s "$BASE/health"
```

## OpenAPI

```bash
curl -s "$BASE/openapi.json" | jq '.info.title, .info.version'
```

## Chat

```bash
curl -s "$BASE/v1/chat" \
  -H 'content-type: application/json' \
  -d '{"message":"What files define the REST API?","tools":true}'
```

## Realtime

```bash
curl -s "$BASE/v1/chat" \
  -H 'content-type: application/json' \
  -d '{
    "message": "Answer like this is a live voice call.",
    "realtime": true,
    "realtime_options": {
      "max_history_messages": 8,
      "max_tokens": 120
    }
  }'
```

## OpenAI-Compatible Chat

```bash
curl -s "$BASE/v1/chat/completions" \
  -H 'content-type: application/json' \
  -d '{
    "model": "qwen3:4b",
    "messages": [
      {"role": "user", "content": "Return one sentence."}
    ]
  }'
```

## Agentic Run

```bash
curl -s -X POST "$BASE/v1/run" \
  -H 'content-type: application/json' \
  -d '{"task":"List the test files related to skill discovery."}'
```

## Events

```bash
curl -N "$BASE/v1/events?type=run.*"
```

## Skill Docs

```bash
curl -s "$BASE/v1/skills/omnius-rest-docs"
```

## Runtime Key

```bash
curl -s -X POST "$BASE/v1/keys" \
  -H 'authorization: Bearer admin-secret' \
  -H 'content-type: application/json' \
  -d '{"scope":"run","owner":"ci","rpm":60,"tpd":100000,"max_jobs":3}'
```
