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

# Stable Image Core

> Our primary service for text-to-image generation, Stable Image Core represents the best quality achievable at high 
speed. No prompt engineering is required! Try asking for a style, a scene, or a character, and see what you get.

### Try it out
Grab your [API key](https://platform.stability.ai/account/keys) and head over to [![Open Google Colab](https://platform.stability.ai/svg/google-colab.svg)](https://colab.research.google.com/github/stability-ai/stability-sdk/blob/main/nbs/Stable_Image_API_Public.ipynb#scrollTo=yXhs626oZdr1)

### How to use
Please invoke this endpoint with a `POST` request.

The headers of the request must include an API key in the `authorization` field. The body of the request must be
`multipart/form-data`, and the `accept` header should be set to one of the following:
  - `image/*` to receive the image in the format specified by the `output_format` parameter.
  - `application/json` to receive the image encoded as base64 in a JSON response.

The body of the request should include:
- `prompt`

The body may optionally include:
- `aspect_ratio`
- `negative_prompt`
- `seed`
- `style_preset`
- `output_format`

> **Note:** for more details about these parameters please see the request schema below.

### Output
The resolution of the generated image will be 1.5 megapixels.

### Credits
Flat rate of 3 credits per successful generation.  You will not be charged for failed generations.



## OpenAPI

````yaml /api-reference/openapi.json post /sd/v2beta/stable-image/generate/core
openapi: 3.0.1
info:
  title: MaxAPI 模型 API
  description: MaxAPI 文本、图像、视频、音频和音乐模型接口。
  version: 1.0.0
servers:
  - url: https://api.maxapi.ai
    description: MaxAPI 生产环境
security: []
tags:
  - name: 模型接口
  - name: 模型接口/绘图模型
  - name: 模型接口/绘图模型/OpenAI Dall-e 格式
  - name: 模型接口/绘图模型/Flux系列
  - name: 模型接口/绘图模型/Flux系列/OpenAI Dalle 格式
  - name: 模型接口/绘图模型/Z-image
  - name: 模型接口/绘图模型/Banana生图异步格式(未来可能兼容其他模型)
  - name: 模型接口/聊天接口（Chat）
  - name: 模型接口/视频模型
  - name: 模型接口/视频模型/谷歌veo
  - name: 模型接口/视频模型/谷歌veo/VertexAI-VEO官方格式
  - name: 模型接口/视频模型/谷歌veo/VertexAI-VEO官方格式/视频生成
  - name: 模型接口/视频模型/谷歌veo/VertexAI-VEO官方格式/任务查询
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式/视频生成
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式/任务查询
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式/下载视频(只有aistudio有这个动作)
  - name: 模型接口/视频模型/谷歌veo/GCP异步任务接口
  - name: 模型接口/视频模型/谷歌veo/官网逆向接口格式
  - name: 模型接口/视频模型/谷歌veo/官网逆向接口格式/视频生成
  - name: 模型接口/视频模型/谷歌veo/官网逆向接口格式/OpenAI官方视频格式(适配 newapi)
  - name: 模型接口/视频模型/Wan阿里万象(官方格式)
  - name: 模型接口/视频模型/豆包seedance(官方格式)
  - name: 模型接口/视频模型/Vidu官方格式
  - name: 模型接口/视频模型/Vidu官方格式/视频生成
  - name: 模型接口/视频模型/Vidu官方格式/图像生成
  - name: 模型接口/视频模型/Vidu官方格式/音频生成
  - name: 模型接口/视频模型/Vidu官方格式/其他功能
  - name: 模型接口/视频模型/Vidu官方格式/任务管理
  - name: 模型接口/视频模型/MiniMax-Hailuo官方格式
  - name: 模型接口/视频模型/MiniMax-Hailuo官方格式/视频生成
  - name: 模型接口/视频模型/MiniMax-Hailuo官方格式/任务管理
  - name: 模型接口/视频模型/MiniMax-Hailuo-OpenAI-Sora兼容格式
  - name: 模型接口/视频模型/MiniMax-Hailuo-OpenAI-Sora兼容格式/视频生成
  - name: 模型接口/视频模型/Sora-2-官方格式
  - name: 模型接口/视频模型/Sora-2-官方格式/创建角色接口
  - name: 模型接口/视频模型/Sora-2026-01-07新格式
  - name: 模型接口/自动补全接口（Completions）
  - name: 模型接口/图像接口（Images）
  - name: 模型接口/向量生成接口（Embeddings）
  - name: 模型接口/音频接口（Audio）
  - name: 模型接口/MJ图像(视频)接口
  - name: 模型接口/MJ图像(视频)接口/InsightFace任务提交
  - name: 模型接口/MJ图像(视频)接口/任务提交
  - name: 模型接口/MJ图像(视频)接口/任务查询
  - name: 模型接口/MJ图像(视频)接口/MJ视频相关
  - name: 模型接口/Suno音乐接口
  - name: 模型接口/Suno音乐接口/GoAmzAI格式
  - name: 模型接口/Suno音乐接口/GoAmzAI格式/v3.5
  - name: 模型接口/Suno音乐接口/GoAmzAI格式/v3.0
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/所有接口
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景1 生成自定义音乐(带歌词)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景 2 通过提示词直接生成音乐(带歌词)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景 4 通过提示词直接生成音乐(纯音乐)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景3 生成自定义音乐(纯音乐)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景 5 上传自定义音频并续写
  - name: 模型接口/Suno音乐接口/生成歌词
  - name: 模型接口/Suno音乐接口/NewAPI兼容格式
  - name: 模型接口/Luma视频接口
  - name: 模型接口/Luma视频接口/GoAmzAI格式
  - name: 模型接口/Luma视频接口/GoAmzAI格式/付费版
  - name: 模型接口/Luma视频接口/GoAmzAI格式/免费版
  - name: 模型接口/Luma视频接口/官网原生格式(v2)
  - name: 模型接口/SD图像接口
  - name: 模型接口/SD图像接口/SD3
  - name: 模型接口/SD图像接口/SDXL
  - name: 模型接口/Fish Audio
  - name: 模型接口/统一视频接口
  - name: 模型接口/统一视频接口/阿里Wan(万相视频
  - name: 模型接口/统一视频接口/Sora2视频
  - name: 模型接口/统一视频接口/Seedance(即梦视频
  - name: 模型接口/统一视频接口/Google-Veo
  - name: 历史接口
  - name: 历史接口/PPT类接入
  - name: 历史接口/请求示例
  - name: 历史接口/原始接口（参数需要定义后才能发送请求）
  - name: 佐糖API
  - name: MewXAI星月熊开放API
  - name: MewXAI星月熊开放API/开放API接口
  - name: MewXAI星月熊开放API/示例
  - name: Ideogram（绘画）
  - name: 可灵API
  - name: RunWay官方API
  - name: 视频生成
  - name: 任务查询
  - name: Wan官方格式
  - name: 图像生成
  - name: 音频生成
  - name: 其他功能
  - name: 任务管理
  - name: InsightFace任务提交
  - name: 任务提交
  - name: Generate
  - name: SDXL & SD1.6
paths:
  /sd/v2beta/stable-image/generate/core:
    post:
      tags:
        - 模型接口/SD图像接口/SD3
        - Generate
      summary: Stable Image Core
      description: >-
        Our primary service for text-to-image generation, Stable Image Core
        represents the best quality achievable at high 

        speed. No prompt engineering is required! Try asking for a style, a
        scene, or a character, and see what you get.


        ### Try it out

        Grab your [API key](https://platform.stability.ai/account/keys) and head
        over to [![Open Google
        Colab](https://platform.stability.ai/svg/google-colab.svg)](https://colab.research.google.com/github/stability-ai/stability-sdk/blob/main/nbs/Stable_Image_API_Public.ipynb#scrollTo=yXhs626oZdr1)


        ### How to use

        Please invoke this endpoint with a `POST` request.


        The headers of the request must include an API key in the
        `authorization` field. The body of the request must be

        `multipart/form-data`, and the `accept` header should be set to one of
        the following:
          - `image/*` to receive the image in the format specified by the `output_format` parameter.
          - `application/json` to receive the image encoded as base64 in a JSON response.

        The body of the request should include:

        - `prompt`


        The body may optionally include:

        - `aspect_ratio`

        - `negative_prompt`

        - `seed`

        - `style_preset`

        - `output_format`


        > **Note:** for more details about these parameters please see the
        request schema below.


        ### Output

        The resolution of the generated image will be 1.5 megapixels.


        ### Credits

        Flat rate of 3 credits per successful generation.  You will not be
        charged for failed generations.
      parameters:
        - name: authorization
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
            description: >-
              Your [Stability API
              key](https://platform.stability.ai/account/keys), used to
              authenticate your requests. Although you may have multiple keys in
              your account, you should use the same key for all requests to this
              API.
            minLength: 1
        - name: content-type
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
            minLength: 1
            description: >-
              The content type of the request body. Do not manually specify this
              header; your HTTP client library will automatically include the
              appropriate boundary parameter.
            example: multipart/form-data
        - name: accept
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
            default: image/*
            description: >-
              Specify `image/*` to get the image bytes directly. Otherwise
              specify `application/json` to receive the image as base64 encoded
              JSON.
            enum:
              - application/json
              - image/*
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 10000
                  description: >-
                    What you wish to see in the output image. A strong,
                    descriptive prompt that clearly defines 

                    elements, colors, and subjects will lead to better results. 


                    To control the weight of a given word use the format
                    `(word:weight)`, 

                    where `word` is the word you'd like to control the weight of
                    and `weight` 

                    is a value between 0 and 1. For example: `The sky was a
                    crisp (blue:0.3) and (green:0.8)`

                    would convey a sky that was blue and green, but more green
                    than blue.
                  example: ''
                aspect_ratio:
                  type: string
                  enum:
                    - '16:9'
                    - '1:1'
                    - '21:9'
                    - '2:3'
                    - '3:2'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '9:21'
                  default: '1:1'
                  description: Controls the aspect ratio of the generated image.
                  example: '1:1'
                negative_prompt:
                  type: string
                  maxLength: 10000
                  description: >-
                    A blurb of text describing what you **do not** wish to see
                    in the output image.  

                    This is an advanced feature.
                  example: ''
                seed:
                  type: number
                  minimum: 0
                  maximum: 4294967294
                  default: 0
                  description: >-
                    A specific value that is used to guide the 'randomness' of
                    the generation. (Omit this parameter or pass `0` to use a
                    random seed.)
                  example: ''
                style_preset:
                  type: string
                  enum:
                    - 3d-model
                    - analog-film
                    - anime
                    - cinematic
                    - comic-book
                    - digital-art
                    - enhance
                    - fantasy-art
                    - isometric
                    - line-art
                    - low-poly
                    - modeling-compound
                    - neon-punk
                    - origami
                    - photographic
                    - pixel-art
                    - tile-texture
                  description: Guides the image model towards a particular style.
                  example: ''
                output_format:
                  type: string
                  enum:
                    - jpeg
                    - png
                    - webp
                  default: png
                  description: Dictates the `content-type` of the generated image.
                  example: png
              required:
                - prompt
            example:
              prompt: ''
              aspect_ratio: '1:1'
              negative_prompt: ''
              seed: ''
              style_preset: ''
              output_format: png
      responses:
        '200':
          description: 图片生成成功。返回格式由请求中的 Accept 头决定。
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                type: object
                properties:
                  image:
                    type: string
                    format: byte
                    description: Base64 编码的图片。
                  finish_reason:
                    type: string
                  seed:
                    type: integer
        '400':
          description: 请求失败
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: >-
                      A unique identifier associated with this error. Please
                      include this in any [support
                      tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

                      you file, as it will greatly assist us in diagnosing the
                      root cause of the problem.
                    example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                  name:
                    type: string
                    minLength: 1
                    description: >-
                      Short-hand name for an error, useful for discriminating
                      between errors with the same status code.
                    example: bad_request
                  errors:
                    type: array
                    items:
                      type: string
                    minItems: 1
                    description: One or more error messages indicating what went wrong.
                    example:
                      - 'some-field: is required'
                required:
                  - id
                  - name
                  - errors
        '403':
          description: 请求失败
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentModerationResponse'
        '422':
          description: 请求失败
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: >-
                      A unique identifier associated with this error. Please
                      include this in any [support
                      tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

                      you file, as it will greatly assist us in diagnosing the
                      root cause of the problem.
                    example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                  name:
                    type: string
                    minLength: 1
                    description: >-
                      Short-hand name for an error, useful for discriminating
                      between errors with the same status code.
                    example: bad_request
                  errors:
                    type: array
                    items:
                      type: string
                    minItems: 1
                    description: One or more error messages indicating what went wrong.
                    example:
                      - 'some-field: is required'
                required:
                  - id
                  - name
                  - errors
                example:
                  id: ff54b236a3acdde1522cb1ba641c43ed
                  name: invalid_language
                  errors:
                    - English is the only supported language for this service.
        '429':
          description: 请求失败
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: >-
                      A unique identifier associated with this error. Please
                      include this in any [support
                      tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

                      you file, as it will greatly assist us in diagnosing the
                      root cause of the problem.
                    example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                  name:
                    type: string
                    minLength: 1
                    description: >-
                      Short-hand name for an error, useful for discriminating
                      between errors with the same status code.
                    example: bad_request
                  errors:
                    type: array
                    items:
                      type: string
                    minItems: 1
                    description: One or more error messages indicating what went wrong.
                    example:
                      - 'some-field: is required'
                required:
                  - id
                  - name
                  - errors
                example:
                  id: rate_limit_exceeded
                  name: rate_limit_exceeded
                  errors:
                    - >-
                      You have exceeded the rate limit of 150 requests within a
                      10 second period, and have been timed out for 60 seconds.
        '500':
          description: 请求失败
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: >-
                      A unique identifier associated with this error. Please
                      include this in any [support
                      tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

                      you file, as it will greatly assist us in diagnosing the
                      root cause of the problem.
                    example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                  name:
                    type: string
                    minLength: 1
                    description: >-
                      Short-hand name for an error, useful for discriminating
                      between errors with the same status code.
                    example: bad_request
                  errors:
                    type: array
                    items:
                      type: string
                    minItems: 1
                    description: One or more error messages indicating what went wrong.
                    example:
                      - 'some-field: is required'
                required:
                  - id
                  - name
                  - errors
                example:
                  id: 2a1b2d4eafe2bc6ab4cd4d5c6133f513
                  name: internal_error
                  errors:
                    - >-
                      An unexpected server error has occurred, please try again
                      later.
      deprecated: false
      security: []
components:
  schemas:
    ContentModerationResponse:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          description: >-
            A unique identifier associated with this error. Please include this
            in any [support
            tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

            you file, as it will greatly assist us in diagnosing the root cause
            of the problem.
          example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
        name:
          type: string
          minLength: 1
          description: >-
            Our content moderation system has flagged some part of your request
            and subsequently denied it.  You were not charged for this request. 
            While this may at times be frustrating, it is necessary to maintain
            the integrity of our platform and ensure a safe experience for all
            users.


            If you would like to provide feedback, please use the [Support
            Form](https://stabilityplatform.freshdesk.com/support/tickets/new).
          enum:
            - content_moderation
        errors:
          type: array
          items:
            type: string
          minItems: 1
          description: One or more error messages indicating what went wrong.
          example:
            - 'some-field: is required'
      required:
        - id
        - name
        - errors
      description: Your request was flagged by our content moderation system.
      example:
        id: ed14db44362126aab3cbd25cca51ffe3
        name: content_moderation
        errors:
          - >-
            Your request was flagged by our content moderation system, as a
            result your request was denied and you were not charged.

````