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

# AI Jobs Direct Quickstart

> Make your first AI inference call against the Livepeer network in under ten minutes. Free community gateway, no API key required for experimentation.

export const CenteredContainer = ({children, maxWidth = "800px", padding = "0", preset = "default", width = "", minWidth = "", marginRight = "", marginBottom = "", textAlign = "", style = {}, className = "", ...rest}) => {
  const presets = {
    default: {},
    fitContent: {
      width: "fit-content",
      minWidth: "fit-content"
    },
    readable70: {
      width: "70%",
      minWidth: "fit-content"
    },
    readable80: {
      width: "80%",
      minWidth: "fit-content"
    },
    readable90: {
      width: "90%"
    },
    wide900: {
      maxWidth: "900px"
    }
  };
  const presetStyle = presets[preset] || presets.default;
  return <div className={className} style={{
    maxWidth: presetStyle.maxWidth || maxWidth,
    margin: "0 auto",
    padding: padding,
    ...presetStyle.width ? {
      width: presetStyle.width
    } : {},
    ...presetStyle.minWidth ? {
      minWidth: presetStyle.minWidth
    } : {},
    ...width ? {
      width
    } : {},
    ...minWidth ? {
      minWidth
    } : {},
    ...marginRight ? {
      marginRight
    } : {},
    ...marginBottom ? {
      marginBottom
    } : {},
    ...textAlign ? {
      textAlign
    } : {},
    ...style
  }} {...rest}>
      {children}
    </div>;
};

export const CustomDivider = ({color = "var(--lp-color-border-default)", middleText = "", spacing = "default", style = {}, className = "", ...rest}) => {
  const spacingPresets = {
    default: {
      margin: "24px 0"
    },
    overlap: {
      margin: "-1rem 0 -1rem 0"
    },
    tight: {
      margin: "0 0 -1rem 0"
    },
    section: {
      margin: "0 0 -2rem 0"
    },
    sectionOverlap: {
      margin: "-1rem 0 -2rem 0"
    },
    deepOverlap: {
      margin: "-1rem 0 -1.5rem 0"
    }
  };
  const spacingStyle = spacingPresets[spacing] || spacingPresets.default;
  return <div role="separator" aria-orientation="horizontal" className={className} style={{
    display: "flex",
    alignItems: "center",
    ...spacingStyle,
    fontSize: style?.fontSize || "16px",
    height: "fit-content",
    ...style
  }} {...rest}>
      <span style={{
    marginRight: "var(--lp-spacing-px-8)",
    opacity: 0.2
  }}>
        <Icon icon="/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg" />
      </span>
      <div style={{
    flex: 1,
    height: "1px",
    background: "var(--lp-color-border-default)",
    opacity: 0.4
  }}></div>
      {middleText && <>
          <Icon icon="circle" size={2} />
          <span style={{
    margin: "0 8px",
    fontWeight: "bold",
    color: color,
    opacity: 0.7
  }}>
            {middleText}
          </span>
          <Icon icon="circle" size={2} />
        </>}
      <div style={{
    flex: 1,
    height: "1px",
    background: "var(--lp-color-border-default)",
    opacity: 0.4
  }}></div>
      <span style={{
    marginLeft: "var(--lp-spacing-px-8)",
    opacity: 0.2
  }}>
        <span style={{
    display: "inline-block",
    transform: "scaleX(-1)"
  }}>
          <Icon icon="/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg" />
        </span>
      </span>
    </div>;
};

export const LinkArrow = ({href, label, description, newline = true, borderColor, className = '', style = {}, ...rest}) => {
  const linkArrowStyle = {
    display: 'inline-flex',
    alignItems: 'center',
    justifyContent: 'center',
    gap: "var(--lp-spacing-1)",
    width: 'fit-content',
    ...borderColor && ({
      borderColor
    })
  };
  return <span className={className} style={style} {...rest}>
      {newline && <br />}
      <span style={linkArrowStyle}>
        <a href={href} target="_blank" rel="noopener noreferrer">
          {label}
        </a>
        <Icon icon="arrow-up-right" size={14} color="var(--lp-color-accent)" />
      </span>
      {description && description}
      {description && <div style={{
    height: "var(--lp-spacing-3)"
  }} />}
    </span>;
};

<CenteredContainer preset="readable90">
  <Tip>Free, off-chain AI inference against the Livepeer Network via the Cloud Community Gateway. Curl in ten minutes.</Tip>
</CenteredContainer>

<CustomDivider />

By the end of this quickstart you'll have run a text-to-image inference call against the Livepeer Network, downloaded the generated image, and seen the same call work through both `@livepeer/ai` (TypeScript) and `livepeer-ai-python`. The path needs only a terminal or a runtime.

The path runs against `dream-gateway.livepeer.cloud`, the free Cloud SPE Community Gateway. It is off-chain, public, and shaped for experimentation. Production workloads should run against a paid Gateway or a self-hosted one; see <LinkArrow href="/v2/developers/navigator" label="navigator" newline={false} /> for the trade-offs.

<CustomDivider />

## Required Tools

Pick one of the three paths below. You need exactly one:

* `curl` (any modern shell)
* Node.js 20 or later, with `npm` or `pnpm`
* Python 3.11 or later, with `pip`

The network does the GPU work. Your machine only sends the request and receives a URL.

<CustomDivider />

## First Call

<Steps>
  <Step title="Send a POST request">
    The community Gateway accepts unauthenticated POSTs at `/text-to-image`. Pick your client below.

    <Tabs>
      <Tab title="curl">
        ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
        curl -X POST https://dream-gateway.livepeer.cloud/text-to-image \
          -H "Content-Type: application/json" \
          -d '{
            "model_id": "ByteDance/SDXL-Lightning",
            "prompt": "A coffee shop at sunset, photorealistic",
            "width": 1024,
            "height": 1024
          }'
        ```
      </Tab>

      <Tab title="Node (fetch)">
        ```js theme={"theme":{"light":"github-light","dark":"dark-plus"}}
        const res = await fetch('https://dream-gateway.livepeer.cloud/text-to-image', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({
            model_id: 'ByteDance/SDXL-Lightning',
            prompt: 'A coffee shop at sunset, photorealistic',
            width: 1024,
            height: 1024,
          }),
        });
        const data = await res.json();
        console.log(data.images[0].url);
        ```
      </Tab>

      <Tab title="Python (requests)">
        ```python theme={"theme":{"light":"github-light","dark":"dark-plus"}}
        import requests

        res = requests.post(
            "https://dream-gateway.livepeer.cloud/text-to-image",
            json={
                "model_id": "ByteDance/SDXL-Lightning",
                "prompt": "A coffee shop at sunset, photorealistic",
                "width": 1024,
                "height": 1024,
            },
        )
        print(res.json()["images"][0]["url"])
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Inspect the response">
    The Gateway returns a JSON object with an `images` array. Each image has a hosted URL, a deterministic `seed`, and an NSFW classifier flag.

    ```json theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    {
      "images": [
        {
          "url": "https://dream-gateway.livepeer.cloud/stream/d0fc1fc6/8fdf5a94.png",
          "seed": 2562822894,
          "nsfw": false
        }
      ]
    }
    ```

    The `url` is publicly fetchable.
  </Step>

  <Step title="Download the image">
    ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    curl -O https://dream-gateway.livepeer.cloud/stream/d0fc1fc6/8fdf5a94.png
    ```

    Open the downloaded `.png`. That image was generated on a GPU run by an independent Orchestrator on the Livepeer Network.
  </Step>
</Steps>

<CustomDivider />

## SDK Path

The same call works through the official SDKs. Pick the language that matches your project.

<Tabs>
  <Tab title="@livepeer/ai (TypeScript)">
    Install the package:

    ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    npm install @livepeer/ai
    ```

    Call the Gateway:

    ```ts theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    import { Livepeer } from '@livepeer/ai';

    const livepeer = new Livepeer({
      serverURL: 'https://dream-gateway.livepeer.cloud',
    });

    const result = await livepeer.generate.textToImage({
      modelId: 'ByteDance/SDXL-Lightning',
      prompt: 'A coffee shop at sunset, photorealistic',
      width: 1024,
      height: 1024,
    });

    console.log(result.imageResponse?.images[0]?.url);
    ```

    The SDK wraps the same REST surface and handles request shaping, error types, and retries.
  </Tab>

  <Tab title="livepeer-ai-python">
    Install the package:

    ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    pip install livepeer-ai
    ```

    Call the Gateway:

    ```python theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    from livepeer_ai import Livepeer

    client = Livepeer(server_url="https://dream-gateway.livepeer.cloud")

    result = client.generate.text_to_image(request={
        "model_id": "ByteDance/SDXL-Lightning",
        "prompt": "A coffee shop at sunset, photorealistic",
        "width": 1024,
        "height": 1024,
    })

    print(result.image_response.images[0].url)
    ```

    Speakeasy-generated from the same OpenAPI spec as the TypeScript SDK.
  </Tab>
</Tabs>

<CustomDivider />

## Pipeline Models

The text-to-image pipeline accepts any diffusion model supported by `ai-runner`. Two models are kept warm on the network and respond immediately:

| Model                               | Notes                                          |
| ----------------------------------- | ---------------------------------------------- |
| `ByteDance/SDXL-Lightning`          | Fast, four-step inference. Recommended default |
| `SG161222/RealVisXL_V4.0_Lightning` | Photorealistic, four-step variant              |

Other supported models (cold-start on first request, then warm):

* `stabilityai/stable-diffusion-xl-base-1.0`
* `SG161222/Realistic_Vision_V6.0_B1_noVAE`
* `runwayml/stable-diffusion-v1-5`
* `prompthero/openjourney-v4`
* `stabilityai/sd-turbo`, `stabilityai/sdxl-turbo` (limited-commercial licence)

A cold model takes between 30 seconds and a few minutes for the first response while an Orchestrator loads it into GPU memory.

For all available pipelines (image-to-image, image-to-video, audio-to-text, LLM, and more), see <LinkArrow href="/v2/developers/build/ai-and-agents/ai-pipelines" label="AI pipelines" newline={false} />.

<CustomDivider />

## Common Errors

<AccordionGroup>
  <Accordion title="No orchestrator available for model">
    No Orchestrator on the network currently has capacity for the requested model. Retry after a short wait, or pick one of the warm models above. The pipeline reference page lists which models are kept warm.
  </Accordion>

  <Accordion title="Cold model load (slow first request)">
    The first request to a non-warm model triggers an Orchestrator to load weights into GPU memory. Subsequent requests against the same model are fast. The community Gateway does not stream progress; the request blocks until the model is ready.
  </Accordion>

  <Accordion title="Validation error on `width` or `height`">
    Most SDXL-family models accept multiples of 64 between 512 and 1024. Drop down to 768 or 1024 squared if a request fails on dimensions.
  </Accordion>

  <Accordion title="Rate limit on the community gateway">
    The community Gateway is shared infrastructure. High-volume callers should move to a paid Gateway or self-host. A paid Gateway accepts the same request shape; pass a Bearer token in the `Authorization` header.
  </Accordion>
</AccordionGroup>

<Warning>
  The community Gateway is shaped for experimentation. Production workloads should run against a paid Gateway or a self-hosted Gateway. See <LinkArrow href="/v2/developers/navigator" label="navigator" newline={false} />.
</Warning>

<CustomDivider />

You now have a working inference call against the Livepeer Network. The [AI pipelines](/v2/developers/build/ai-and-agents/ai-pipelines) page documents all nine batch endpoints with request schemas and curl examples for each.

## Next Steps

<CardGroup cols={2}>
  <Card title="AI Pipelines" icon="layer-group" href="/v2/developers/build/ai-and-agents/ai-pipelines">
    The eleven native pipelines, request shapes, and what each one solves.
  </Card>

  <Card title="AI SDKs Overview" icon="code" href="/v2/developers/build/ai-and-agents/ai-sdks-overview">
    Full SDK surface: error types, retries, streaming, batching.
  </Card>

  <Card title="Model Support" icon="cube" href="/v2/developers/build/ai-and-agents/model-support">
    Warm models per pipeline, VRAM requirements, custom-model paths.
  </Card>

  <Card title="AI Image Generation App" icon="palette" href="/v2/developers/build/tutorials/ai-image-generation-app">
    Wrap this quickstart in a working Next.js app.
  </Card>
</CardGroup>
