# Prompt enhance

`POST /v1/prompts/enhance` — Rewrite or invent a prompt — inventing is free, rewriting needs a plan.

- Base URL: https://eroq.ai/v1
- Auth: `Authorization: Bearer eroq_sk_…` (create keys at https://eroq.ai/dashboard/keys)
- Credits: Free · rewrite needs a plan

The sparkle button as an API: give it a rough draft (or nothing) and it answers with one production-grade prompt. `kind` picks the register (`video` default, `image`, or `element` — a reusable visual description of a place, object or style, sized for the element's 600-character `description`); `model` tunes the phrasing to an engine; `elements` passes library ids the writer must feature — their `@Name` mentions are kept verbatim.

Costs no credits. Inventing a prompt — an empty `prompt`, the **Surprise me** case — is free for every account; rewriting a non-empty draft is a **paid-plan perk**, so a pay-as-you-go account gets `403 plan_required` only in that case.

**`kind: "music"` — the songwriter.** Send the song so far: `prompt` (an idea in one sentence), `style`, `lyrics`, `title`, `instrumental`, `seconds`. Fields you send are KEPT; the writer fills the empty ones and answers `{ prompt, title, style, lyrics }` — `prompt` is the one-sentence idea, `lyrics` carry section tags sized to `seconds`. Writing lyrics from scratch (empty `lyrics`) is free; sending `lyrics` asks for a REWRITE of them, the paid-plan perk. The same content policy as POST /v1/music/generations applies to what you send and to what comes back.

## POST /v1/prompts/enhance

Rewrite or invent a prompt — inventing is free, rewriting needs a plan.

### Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `prompt` | string | no | The draft. Empty = invent one. |
| `kind` | string | no | `video` (default), `image`, `element` or `music` (the songwriter — see the notes). |
| `elementKind` | string | no | `kind: element` only — `location`, `object` (default) or `style`. |
| `context` | string | no | `kind: video` only — where the shot sits in a film (the scene before it, how this one follows): the rewrite keeps the characters, place and light going and describes this scene only. With an empty `prompt`, it invents the next scene. Up to 3,000 characters. |
| `name` | string | no | `kind: element` only — the element's name, so the description fits it. |
| `model` | string | no | Target model id — phrasing adapts to the engine. |
| `elements` | array | no | Element ids to feature (characters as `char:<id>`). |
| `style` | string | no | `kind: music` only — how the song sounds (kept when sent, written when empty). |
| `lyrics` | string | no | `kind: music` only — lyrics to REWRITE (a paid-plan perk). Empty = written from scratch, free. |
| `title` | string | no | `kind: music` only — the song's title (kept when sent). |
| `instrumental` | boolean | no | `kind: music` only — no vocals: no lyrics are written. |
| `seconds` | integer | no | `kind: music` only — the song's length, so the lyrics fit it (snapped to 30–240 s). |

### Example request

```bash
curl https://eroq.ai/v1/prompts/enhance \
  -H "Authorization: Bearer $EROQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "a girl on a rooftop at night",
  "kind": "video"
}'
```

```javascript
const res = await fetch('https://eroq.ai/v1/prompts/enhance', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.EROQ_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "prompt": "a girl on a rooftop at night",
    "kind": "video"
  }),
})
console.log(await res.json())
```

```python
import os, requests

res = requests.post(
    "https://eroq.ai/v1/prompts/enhance",
    headers={"Authorization": f"Bearer {os.environ['EROQ_API_KEY']}"},
    json={
        "prompt": "a girl on a rooftop at night",
        "kind": "video"
    },
)
print(res.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "prompt": "a girl on a rooftop at night",
  "kind": "video"
}`)

	req, _ := http.NewRequest("POST", "https://eroq.ai/v1/prompts/enhance", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EROQ_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```

### Response


```json
{
  "prompt": "A solitary young woman on a rain-slicked rooftop at night, city bokeh behind her…"
}
```

---
Canonical: https://eroq.ai/docs/enhance · Index for agents: https://eroq.ai/llms.txt · OpenAPI: https://eroq.ai/openapi.json
