# Generate a sticker

`POST https://api.vidmoat.com/v1/ai/stickers`

- Scope: `ai.image`
- Cost: 20 credits

Generate a cut-out sticker with a transparent background (a PNG, or an SVG when the vector fallback is used). Creator and Studio.

### Body

- `prompt` (string, required): Up to 300 characters.
- `style` (enum, optional, default `cartoon`): Look. Unknown values become `cartoon`. One of `cartoon`, `kawaii`, `retro`, `neon`, `3d`, `minimal`.

## Response

Returns `200`.

### Response fields

- `url` (string): The sticker.
- `kind` (enum): File type. One of `png`, `svg`.
- `credits` (object): `{ charged, remaining }`: what this call cost and the balance after it.
- `hint` (string): What to do with it.

> **Tip: With a test key.** Test keys return a sample sticker and spend nothing.

## Errors

Besides the errors any request can get ([authentication](https://developer.vidmoat.com/developer/docs/authentication#when-a-request-is-refused), [rate limits](https://developer.vidmoat.com/developer/docs/rate-limits)):

| Status | Code | When |
| --- | --- | --- |
| 402 | [`plan_required`](https://developer.vidmoat.com/developer/docs/errors#plan_required) | The plan has no stickers. |
| 402 | [`insufficient_credits`](https://developer.vidmoat.com/developer/docs/errors#insufficient_credits) | The balance cannot cover the call. Nothing ran. `remaining` is the balance. |
| 422 | [`prompt_rejected`](https://developer.vidmoat.com/developer/docs/errors#prompt_rejected) | The prompt failed the safety check. Nothing was charged. `field` names the field. |
| 502 | [`provider_error`](https://developer.vidmoat.com/developer/docs/errors#provider_error) | The generation provider failed. The charge is refunded. |

## Request examples

```bash curl
curl -X POST https://api.vidmoat.com/v1/ai/stickers \
  -H "Authorization: Bearer $VIDMOAT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"a winking crab"}'
```

```js Node
const res = await fetch('https://api.vidmoat.com/v1/ai/stickers', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.VIDMOAT_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    prompt: 'a winking crab',
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? `HTTP ${res.status}`);
console.log(data);
```

```python Python
import os
import requests

res = requests.post(
    "https://api.vidmoat.com/v1/ai/stickers",
    headers={"Authorization": f"Bearer {os.environ['VIDMOAT_KEY']}"},
    json={
      "prompt": "a winking crab",
    },
    timeout=60,
)
res.raise_for_status()
print(res.json())
```

## Example response

```json
{
  "url": "https://api.vidmoat.com/uploads/sticker-1.png",
  "kind": "png",
  "credits": { "charged": 20, "remaining": 4420 },
  "hint": "Use `url` as an addClip `src` with type: \"image\"."
}
```

---

Source: https://developer.vidmoat.com/developer/docs/api/generation/create-sticker
Previous: [Generate an image](https://developer.vidmoat.com/developer/docs/api/generation/create-image.md)
Next: [Generate a video](https://developer.vidmoat.com/developer/docs/api/generation/create-video.md)
All documentation: https://developer.vidmoat.com/llms-full.txt
