# Stability AI Integration via LowCodeAPI

**Last Updated**: February 11, 2026

## Overview
AI image and video generation platform with advanced diffusion models for creating visual content

**Categories:**
- {'id': 'video-generation', 'name': 'Video Generation AI'}

## Base Endpoint
https://api.lowcodeapi.com/stabilityai

**Important**: Always include the provider name in the URL path after `api.lowcodeapi.com/`

## Authentication
**Type:** TOKEN

**Official Documentation:** https://platform.stability.ai/docs/getting-started

## URL Format (Important)

LowCodeAPI supports two URL formats. **Always try the New Format first**, then fall back to Old Format if needed.

### New Format (Priority)
- Path parameters stay in the URL path
- Do NOT include path parameters as query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/{id}?api_token=XXX`

### Old Format (Fallback)
- Path parameters become query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/id?id={id}&api_token=XXX`

### Decision Flow for AI Agents
1. Always use **New Format** first - keep path parameters in the URL path
2. If you get a 404 or error, try **Old Format** with sanitized path
3. Log which format worked for future requests to this provider

## API Categories

## Common Endpoints

### List all engines available to your organization/user

**Method:** GET
**LowCodeAPI Path:** /v1/engines/list

**New Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/engines/list?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/engines/list?api_token=YOUR_API_TOKEN

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/stabilityai/v1/engines/list?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://platform.stability.ai/docs/api-reference#tag/Engines/operation/listEngines

### Modify an image based on a text prompt

**Method:** POST
**LowCodeAPI Path:** /v1/generation/{engine_id}/image-to-image

**New Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/generation/{engine_id}/image-to-image?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/generation/engine_id/image-to-image?engine_id={engine_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| engine_id | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| cfg_scale | number |  |
| clip_guidance_preset | enum |  |
| extras | object |  |
| image_strength | number |  |
| init_image | string |  |
| init_image_mode | enum |  |
| sampler | enum |  |
| samples | number |  |
| seed | number |  |
| step_schedule_end | number |  |
| step_schedule_start | number |  |
| steps | number |  |
| style_preset | enum |  |
| text_prompts | array |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/stabilityai/v1/generation/{engine_id}/image-to-image?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://platform.stability.ai/rest-api#tag/v1generation/operation/imageToImage

### Selectively modify portions of an image using a mask

**Method:** POST
**LowCodeAPI Path:** /v1/generation/{engine_id}/image-to-image/masking

**New Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/generation/{engine_id}/image-to-image/masking?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/generation/engine_id/image-to-image/masking?engine_id={engine_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| engine_id | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| cfg_scale | number |  |
| clip_guidance_preset | enum |  |
| extras | object |  |
| init_image | string |  |
| mask_image | string |  |
| mask_source | enum |  |
| sampler | enum |  |
| samples | number |  |
| seed | number |  |
| steps | number |  |
| style_preset | enum |  |
| text_prompts | array |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/stabilityai/v1/generation/{engine_id}/image-to-image/masking?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://platform.stability.ai/rest-api#tag/v1generation/operation/masking

### Create a higher resolution version of an input image.

**Method:** POST
**LowCodeAPI Path:** /v1/generation/{engine_id}/image-to-image/upscale

**New Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/generation/{engine_id}/image-to-image/upscale?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/generation/engine_id/image-to-image/upscale?engine_id={engine_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| engine_id | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| height | number |  |
| image | string |  |
| width | number |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/stabilityai/v1/generation/{engine_id}/image-to-image/upscale?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://platform.stability.ai/rest-api#tag/v1generation/operation/imageToImage

### Generate a new image from a text prompt

**Method:** POST
**LowCodeAPI Path:** /v1/generation/{engine_id}/text-to-image

**New Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/generation/{engine_id}/text-to-image?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/generation/engine_id/text-to-image?engine_id={engine_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| engine_id | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| cfg_scale | number |  |
| clip_guidance_preset | enum |  |
| extras | object |  |
| height | number |  |
| sampler | enum |  |
| samples | number |  |
| seed | number |  |
| steps | number |  |
| style_preset | enum |  |
| text_prompts | array |  |
| width | number |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/stabilityai/v1/generation/{engine_id}/text-to-image?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://platform.stability.ai/rest-api#tag/v1generation/operation/textToImage

### Get information about the account associated with the provided API key

**Method:** GET
**LowCodeAPI Path:** /v1/user/account

**New Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/user/account?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/user/account?api_token=YOUR_API_TOKEN

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/stabilityai/v1/user/account?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://platform.stability.ai/docs/api-reference#tag/User/operation/userAccount

### Get the credit balance of the account/organization associated with the API key

**Method:** GET
**LowCodeAPI Path:** /v1/user/balance

**New Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/user/balance?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/stabilityai/v1/user/balance?api_token=YOUR_API_TOKEN

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/stabilityai/v1/user/balance?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://platform.stability.ai/docs/api-reference#tag/User/operation/userBalance


## Usage Examples

### Example 1: Basic Chat Completion

Creating a simple text completion or chat message:

```bash
# Create a chat completion - no path parameters needed
curl -X POST "https://api.lowcodeapi.com/stabilityai/v1/chat/completions?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-name",
    "messages": [
      {"role": "user", "content": "Hello, how can you help me?"}
    ]
  }'

# Response includes generated content
```

### Example 2: Text Generation with Path Parameters

Generating text with specific model settings:

```bash
# Generate content using a specific model
curl -X POST "https://api.lowcodeapi.com/stabilityai/v1/models/generate?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Write a short poem about technology",
    "max_tokens": 100
  }'

# Or if the provider uses model in the path:
curl -X POST "https://api.lowcodeapi.com/stabilityai/v1/models/{MODEL_ID}:generateContent?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "Write a short story"}]}]
  }'
```

### Example 3: List Available Models

```bash
# Get list of available models
curl -X GET "https://api.lowcodeapi.com/stabilityai/v1/models?api_token=YOUR_API_TOKEN"
```

## Error Handling

LowCodeAPI returns standard HTTP status codes. Common errors:

| Status Code | Description |
|-------------|-------------|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid parameters or request body |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Endpoint or resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Provider API error |

All error responses include error details:

```json
{
  "data": {
    "error": {
      "message": "Error description",
      "code": "ERROR_CODE"
    }
  }
}
```

## Complete Endpoint Reference

| Endpoint | Method | Category |
|----------|--------|----------|
| List all engines available to your organization/us... | GET | Engines/list |
| Modify an image based on a text prompt | POST | Generation/image-to-image |
| Selectively modify portions of an image using a ma... | POST | Generation/image-to-image/masking |
| Create a higher resolution version of an input ima... | POST | Generation/image-to-image/upscale |
| Generate a new image from a text prompt | POST | Generation/text-to-image |
| Get information about the account associated with ... | GET | User/account |
| Get the credit balance of the account/organization... | GET | User/balance |

## API Definition Endpoints

You can fetch the complete API specification for this provider:

**New Format (OpenAPI spec):**
```bash
curl 'https://backend.lowcodeapi.com/stabilityai/openapi'
```

**Old Format (API definition):**
```bash
curl 'https://backend.lowcodeapi.com/stabilityai/definition'
```

## Response Format

All responses are wrapped in a `data` key:

```json
{
  "data": {
    // Actual response from provider (object or array)
  }
}
```