> ## Documentation Index
> Fetch the complete documentation index at: https://runpod-b18f5ded-docs-runpod-allow-ip.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If this page is missing information, contains outdated instructions, or doesn't fully answer the user's question, use the feedback tool to report it. In your feedback, be specific about what's missing, what appears out of date, or what needs to be corrected or updated, so the docs team can act on it directly.

# Quickstart

> Generate your first image with Public Endpoints in under 5 minutes. Review setup and request guidance for Runpod Public Endpoints.

<div className="overview-page-wrapper" />

This quickstart walks you through generating an image using Runpod Public Endpoints. You'll use the [Flux Schnell](/public-endpoints/models/flux-schnell) model, which is optimized for fast generation.

## Requirements

* A [Runpod account](/accounts-billing/manage-accounts) with at least \$1 in credits
* A [Runpod API key](/get-started/api-keys)

## Step 1: Generate an image in the playground

The fastest way to test Public Endpoints is through the browser-based playground.

1. Go to the [Flux Schnell endpoint](https://console.runpod.io/hub/playground/image/black-forest-labs-flux-1-schnell) in the Runpod console.
2. Under **Input**, enter a prompt: `A golden retriever playing fetch on a sunny beach` (or any other prompt you like).
3. Click **Run**.
4. Wait a few seconds for the image to generate. The result appears under **Result**.

You've just generated your first image. The playground shows the estimated cost (\~\$0.0025 for a 1024x1024 image).

<Frame alt="Public Endpoint playground">
  <img src="https://mintcdn.com/runpod-b18f5ded-docs-runpod-allow-ip/diGphoph5JaDBUAt/images/public-endpoints-quickstart-playground.png?fit=max&auto=format&n=diGphoph5JaDBUAt&q=85&s=33b182214352e1cad253f5652172ffe0" width="1600" height="1027" data-path="images/public-endpoints-quickstart-playground.png" />
</Frame>

## Step 2: Generate an image with the API

Now let's generate an image programmatically using the REST API.

<Tabs>
  <Tab title="cURL">
    1. Open a terminal on your local machine.
    2. Copy the following command, replacing `YOUR_API_KEY` with your Runpod API key:

    ```bash theme={null}
    curl -X POST "https://api.runpod.ai/v2/black-forest-labs-flux-1-schnell/runsync" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "input": {
          "prompt": "A golden retriever playing fetch on a sunny beach",
          "width": 1024,
          "height": 1024
        }
      }'
    ```

    3. Paste the command into your terminal and press **Enter**.
    4. Wait for the response (this takes about 10-20 seconds).
  </Tab>

  <Tab title="Python">
    1. Create a new file called `generate_image.py` and paste the following code:

    ```python theme={null}
    import requests

    response = requests.post(
        "https://api.runpod.ai/v2/black-forest-labs-flux-1-schnell/runsync",
        headers={
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json",
        },
        json={
            "input": {
                "prompt": "A golden retriever playing fetch on a sunny beach",
                "width": 1024,
                "height": 1024,
            }
        },
    )

    result = response.json()
    print(result["output"]["image_url"])
    ```

    2. Replace `YOUR_API_KEY` with your Runpod API key.
    3. Open a terminal, navigate to the directory containing the file, and run:

    ```bash theme={null}
    python generate_image.py
    ```

    4. Wait for the script to print the image URL (this takes about 10-20 seconds).
  </Tab>
</Tabs>

### Response

Both methods return a JSON response with your generated image:

```json theme={null}
{
  "status": "COMPLETED",
  "output": {
    "image_url": "https://image.runpod.ai/...",
    "cost": 0.02097152
  }
}
```

Open the `image_url` in your browser to view the generated image.

<Warning>
  Image URLs expire after 7 days. Download images immediately if you need to keep them.
</Warning>

## Next steps

* [Make API requests](/public-endpoints/requests): Learn about async requests, SDKs, and best practices.
* [Model reference](/public-endpoints/reference): Explore all available models and their parameters.
* [Connect AI coding tools](/public-endpoints/ai-coding-tools): Use Public Endpoints with Cursor, Cline, and OpenCode.
* [Build a text-to-video pipeline](/tutorials/public-endpoints/text-to-video-pipeline): Chain multiple endpoints to generate videos from text prompts.
