> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nsfw-api.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create a key, submit an image generation, and retrieve the result.

## Before you begin

You need an NSFW API account with a funded balance, a project, and an API key with these scopes:

* `generations:write`
* `jobs:read`

Create them in the [dashboard](https://nsfw-api.net/app).

<Warning>
  The raw API key is shown only once. Store it in a secret manager and never expose it in browser code or a public repository.
</Warning>

## Submit a generation

```bash theme={null}
curl https://nsfw-api.net/v1/images/generations \
  -H "Authorization: Bearer $NSFW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"z-image-spicy","prompt":"A lighthouse at sunrise"}'
```

A valid request returns HTTP `202` with a job ID and the amount reserved from your balance.

## Check the job

```bash theme={null}
curl https://nsfw-api.net/v1/jobs/job_... \
  -H "Authorization: Bearer $NSFW_API_KEY"
```

Poll no more than once per second until `status` is one of:

* `succeeded`
* `failed`
* `cancelled`
* `expired`

A succeeded job includes `data` with short-lived signed URLs. Download the bytes before the URLs and stored outputs expire.

<Card title="View the API Reference" icon="brackets-curly" href="/api-reference/create-image">
  Inspect the complete request and response schema or try the endpoint in the playground.
</Card>
