> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portkey.ai/docs/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:

```python Python icon="python" theme={"system"}
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={"system"}
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={"system"}
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"
    }'
```

## 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] [Complete Setup Guide](https://docs.portkey.ai/docs/product/model-catalog.md)
>
> See all setup options and detailed configuration instructions

***

## 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.

***

## Next Steps

> [card] [Gateway Configs](https://docs.portkey.ai/docs/product/ai-gateway.md)
>
> Add fallbacks, load balancing, and more

> [card] [Observability](https://docs.portkey.ai/docs/product/observability.md)
>
> Monitor and trace your Segmind requests

> [card] [Caching](https://docs.portkey.ai/docs/product/ai-gateway/cache-simple-and-semantic.md)
>
> Cache generated images

> [card] [Image API Reference](https://docs.portkey.ai/docs/api-reference/inference-api/images/create-image.md)
>
> Complete image generation API docs

For complete SDK documentation:

> [card] [SDK Reference](https://docs.portkey.ai/docs/api-reference/sdk/list.md)
>
> Complete Portkey SDK documentation

***

> [card] [Portkey is now PRISMA AIRS AI Gateway. See it in action.](https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey\&utm_medium=referral\&utm_campaign=prisma_airs\&utm_content=docs_nav#contact)
>
> Contact Us


## Related topics

- [Segmind](https://docs.portkey.ai/docs/guides/integrations/segmind.md)
- [Overview](https://docs.portkey.ai/docs/guides/integrations.md)
- [Portkey Models](https://docs.portkey.ai/docs/product/model-catalog/portkey-models.md)
- [October](https://docs.portkey.ai/docs/changelog/2024/oct.md)
- [Supported Providers](https://docs.portkey.ai/docs/api-reference/inference-api/supported-providers.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.