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

# NovelAI Text to Image API Documentation

> Use the NovelAI text-to-image API to generate anime-style images from prompts for characters, illustrations, concept art, and creative ideation.

<Note>
  Focused on anime-style image generation, supporting text-to-image, sketch-to-final, and image redraw functionalities.
</Note>


## OpenAPI

````yaml openapi/en/novel.json POST /novelai/text-to-image
openapi: 3.1.0
info:
  title: Novel API DOCS
  version: 1.0.0
  description: TTAPI Novel AI API service
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /novelai/text-to-image:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    GenerateRequest:
      type: object
      properties:
        prompt:
          type: string
          description: Image description for generation or modification
        model:
          type: string
          description: Model to use
          default: nai-diffusion-4-5-curated
          enum:
            - nai-diffusion-4-5-full
            - nai-diffusion-4-5-curated
        'n':
          type: integer
          default: 1
          description: Number of images to generate  1 - 4
        width:
          type: integer
          default: 1024
          description: Image width
        height:
          type: integer
          default: 1024
          description: Image height
        seed:
          type: string
          description: Seed
        steps:
          type: integer
          description: Number of sampling steps
          default: 23
        scale:
          type: number
          description: >-
            A lower guidance scale produces softer, more painterly results. A
            higher guidance scale produces finer details and sharper effects.
          default: 5
        negative_prompt:
          type: string
          description: Unwanted content
        quality_toggle:
          type: boolean
          description: Quality toggle
          default: true
        sampler:
          type: string
          description: Sampler
          default: Euler Ancestral
          enum:
            - Euler Ancestral
            - Euler
            - DPM++ 2S Ancestral
            - DPM++ 2M SDE
            - DPM++ 2M
            - DPM++ SDE
        noise_schedule:
          type: string
          description: Noise schedule
          default: karras
          enum:
            - karras
            - exponential
            - polyexponential
        character_prompts:
          type: array
          description: Character list
          items:
            type: object
            properties:
              prompt:
                type: string
                description: Character information
              uc:
                type: string
                description: Unwanted character content
                example: blurred, extra accessories
              center:
                type: object
                description: Character center coordinates in the frame
                properties:
                  x:
                    type: number
                    description: X-axis coordinate (between 0-1)
                    default: 0.5
                  'y':
                    type: number
                    description: Y-axis coordinate (between 0-1)
                    default: 0.5
                required:
                  - x
                  - 'y'
            required:
              - prompt
              - center
        vibe_transfer:
          type: array
          description: Atmosphere transfer reference
          items:
            type: object
            properties:
              image:
                type: string
                description: Image, URL or base64
                example: https://example.com/ref1.jpg
              strength:
                type: number
                description: Reference strength >= 0 <= 1
                default: 0.6
            required:
              - image
        character_reference:
          type: array
          description: Precise reference
          items:
            type: object
            properties:
              image:
                type: string
                description: Image, URL or base64
                example: https://example.com/ref2.jpg
              type:
                type: string
                description: Reference type
                enum:
                  - character&style
                  - character
                  - style
                default: character&style
              strength:
                type: number
                description: >-
                  Reference strength >= 0 <= 1. A lower value gives the AI more
                  creative freedom, a higher value makes AI follow the reference
                  more closely, possibly replicating facial expressions, angles,
                  and poses.
                default: 1
              fidelity:
                type: number
                description: Fidelity >= 0 <= 1
                default: 0
            required:
              - image
        hook_url:
          type: string
          description: >-
            Callback URL. The task completion or failure will be sent to this
            URL. The data structure is consistent with the <a href="fetch"
            target="_self">fetch structure</a>. If not set, you need to call the
            <a href="fetch" target="_self">fetch API</a> to query.
      required:
        - prompt
        - model
  responses:
    SuccessResponse:
      description: Request successful
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            required:
              - status
              - message
              - data
    400Response:
      description: Parameter error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Authorization failed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        You can obtain your API key from the <a
        href='https://dashboard.ttapi.io' target='_blank'>TTAPI Dashboard</a>.

````