> ## Documentation Index
> Fetch the complete documentation index at: https://portkey-docs-add-third-party-integration-issues-fixes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Segmind

> Use Segmind's Stable Diffusion models for fast, serverless image generation through Portkey.

## Quick Start

Get started with Segmind in under 2 minutes:

<CodeGroup>
  ```python Python icon="python" theme={null}
  from portkey_ai import Portkey

  # 1. Install: pip install portkey-ai
  # 2. Add @segmind provider in model catalog
  # 3. Use it:

  portkey = Portkey(
      api_key="PORTKEY_API_KEY",
      provider="@segmind"
  )

  image = portkey.images.generate(
      model="sdxl1.0-txt2img",
      prompt="Lucy in the sky with diamonds",
      size="1024x1024"
  )

  print(image.data[0])
  ```

  ```js Javascript icon="square-js" theme={null}
  import Portkey from 'portkey-ai'

  // 1. Install: npm install portkey-ai
  // 2. Add @segmind provider in model catalog
  // 3. Use it:

  const portkey = new Portkey({
      apiKey: "PORTKEY_API_KEY",
      provider: "@segmind"
  })

  const image = await portkey.images.generate({
      model: "sdxl1.0-txt2img",
      prompt: "Lucy in the sky with diamonds",
      size: "1024x1024"
  })

  console.log(image.data[0])
  ```

  ```bash cURL theme={null}
  curl https://api.portkey.ai/v1/images/generations \
      -H "Content-Type: application/json" \
      -H "x-portkey-api-key: $PORTKEY_API_KEY" \
      -H "x-portkey-provider: @segmind" \
      -d '{
          "model": "sdxl1.0-txt2img",
          "prompt": "Lucy in the sky with diamonds",
          "size": "1024x1024"
      }'
  ```
</CodeGroup>

## Add Provider in Model Catalog

Before making requests, add Segmind to your Model Catalog:

1. Go to [**Model Catalog → Add Provider**](https://app.portkey.ai/model-catalog/providers)
2. Select **Segmind**
3. Enter your [Segmind API key](https://cloud.segmind.com/console/api-keys)
4. Name your provider (e.g., `segmind`)

<Card title="Complete Setup Guide" icon="book" href="/product/model-catalog">
  See all setup options and detailed configuration instructions
</Card>

***

## Supported Models

Segmind provides fast, serverless access to various Stable Diffusion models:

| Model                 | Description         |
| --------------------- | ------------------- |
| sdxl1.0-txt2img       | Stable Diffusion XL |
| sd1.5-dreamshaper     | Dream Shaper        |
| sd1.5-realisticvision | Realistic Vision    |
| sd1.5-juggernaut      | Juggernaut          |
| sd1.5-epicrealism     | Epic Realism        |
| kandinsky2.2-txt2img  | Kandinsky           |
| qrsd1.5-txt2img       | QR Code Generator   |

And 20+ more models. Check [Segmind's documentation](https://docs.segmind.com/) for the complete list.

<Note>
  Portkey uses the OpenAI image generation signature for Segmind, allowing you to easily switch between providers.
</Note>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Gateway Configs" icon="sliders" href="/product/ai-gateway">
    Add fallbacks, load balancing, and more
  </Card>

  <Card title="Observability" icon="chart-line" href="/product/observability">
    Monitor and trace your Segmind requests
  </Card>

  <Card title="Caching" icon="database" href="/product/ai-gateway/cache-simple-and-semantic">
    Cache generated images
  </Card>

  <Card title="Image API Reference" icon="image" href="/api-reference/inference-api/images/create-image">
    Complete image generation API docs
  </Card>
</CardGroup>

For complete SDK documentation:

<Card title="SDK Reference" icon="code" href="/api-reference/sdk/list">
  Complete Portkey SDK documentation
</Card>
