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

# generate image

> Generate an image from a prompt (text-to-image), from a source image (image-to-image, edit_points and mask_ref for local changes), or from several inputs (ingredients-to-image), on the account's default model or a named one. Settings are validated against list_models and set the price. Returns a job; get_jobs returns the item when it lands. Refunded when the model fails. Credits.



## OpenAPI

````yaml /openapi.json post /tools/generate_image
openapi: 3.1.0
info:
  title: Eversince API
  version: '1'
  description: >-
    Every Eversince tool as one POST call, plus the routes beside them: the tool
    list, account and keys, uploads, webhooks and models. The prose is at
    https://docs.eversince.ai.
servers:
  - url: https://eversince.ai/api/v1
security:
  - bearer: []
tags:
  - name: Discovery
    description: The tool list, the same on the MCP server, the REST API and the CLI.
  - name: Workspace
    description: Jobs, balances, settings, templates, skills and the overview.
  - name: Library
    description: >-
      Items, search, import, reading media, comments, boards, calendars, the
      brand kit and public links.
  - name: Timeline
    description: 'Video editing: timelines, clips, captions, sound, language and rendering.'
  - name: Canvas
    description: 'Still editing: canvases, slides, layers and rendering.'
  - name: Generation
    description: Image, video and audio generation, upscaling, cutouts and models.
  - name: Research
    description: 'What platforms publish: pulling and keeping posts.'
  - name: Account
    description: Balances, keys, workspaces and script sessions.
  - name: Uploads
    description: Files into the library by presigned upload or by URL.
  - name: Webhooks
    description: Job results posted to a URL as they complete.
  - name: Models
    description: Generation models and cost estimates.
paths:
  /tools/generate_image:
    post:
      tags:
        - Generation
      summary: generate image
      description: >-
        Generate an image from a prompt (text-to-image), from a source image
        (image-to-image, edit_points and mask_ref for local changes), or from
        several inputs (ingredients-to-image), on the account's default model or
        a named one. Settings are validated against list_models and set the
        price. Returns a job; get_jobs returns the item when it lands. Refunded
        when the model fails. Credits.
      operationId: generate_image
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/WorkspaceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  description: >-
                    A model id from list_models type image. Omitted: the account
                    default.
                  type: string
                type:
                  type: string
                  description: >-
                    One of text-to-image, image-to-image, ingredients-to-image.
                    Which a given model accepts is in list_models types.
                prompt:
                  type: string
                  description: The prompt, in full.
                settings:
                  description: Per-model settings (validated against list_models).
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties: {}
                source_refs:
                  description: >-
                    The media the model works from. Only the first ref is used
                    on image-to-image, image-to-video and video-to-video; every
                    ref on ingredients-to-* types. Further images go in
                    reference_refs.
                  type: array
                  items:
                    type: string
                reference_refs:
                  description: >-
                    Reference items: images for style or character consistency,
                    videos for motion or style on models that take them
                    (list_models). Audio references go in settings.audioInputs.
                  type: array
                  items:
                    type: string
                edit_points:
                  description: >-
                    Change specific spots and keep the rest, on models with
                    supports_edit_points; the first source_ref is the media.
                    Points are fractions from inspect_media with grid: true
                    (frame mode for video). The prompt may be empty or describe
                    the whole edit. On a picture the marked copy is image 2, so
                    reference_refs start at image 3. Shape and length are kept.
                  minItems: 1
                  maxItems: 8
                  type: array
                  items:
                    type: object
                    properties:
                      x:
                        type: number
                        minimum: 0
                        maximum: 1
                        description: 0 is the left edge, 1 the right.
                      'y':
                        type: number
                        minimum: 0
                        maximum: 1
                        description: 0 is the top edge, 1 the bottom.
                      note:
                        type: string
                        minLength: 1
                        maxLength: 300
                        description: What should change at this point.
                      at_seconds:
                        description: >-
                          Video: the moment the point is on, in seconds into the
                          source.
                        type: number
                        minimum: 0
                    required:
                      - x
                      - 'y'
                      - note
                timeline_id:
                  description: >-
                    With clip_id: the first source_ref is that clip's media,
                    only the part the clip plays is sent (and priced), and the
                    result takes the clip's slot when it lands, its place and
                    look kept.
                  type: string
                clip_id:
                  description: 'With timeline_id: the clip to edit and replace.'
                  type: string
                folder:
                  description: >-
                    Folder path or id for the output; it must exist
                    (organize_items create_folders). Omitted: the workspace
                    generations folder.
                  type: string
                idempotency_key:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: >-
                    A key you mint per dispatch (a UUID). The same key on a
                    retry returns the job already dispatched instead of charging
                    again; a new attempt takes a new key.
                mask_ref:
                  description: >-
                    A masked edit (image-to-image on models with supports_mask):
                    a PNG item the size of the source, transparent where the
                    model repaints, opaque where it keeps. The prompt says what
                    goes in the painted region.
                  type: string
                context:
                  description: 'Optional: one sentence shown to the user beside this action.'
                  type: string
                  maxLength: 600
              required:
                - type
                - prompt
                - idempotency_key
      responses:
        '200':
          description: >-
            Done, or a job started for work that runs longer (follow it with
            get_jobs).
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data
                  - meta
                properties:
                  ok:
                    const: true
                  data:
                    type: object
                    additionalProperties: true
                  meta:
                    type: object
                    properties:
                      request_id:
                        type: string
                      cost:
                        $ref: '#/components/schemas/Cost'
                      cloud_processing:
                        $ref: '#/components/schemas/CloudProcessing'
                  media:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
      description: >-
        Retry a paid dispatch safely: the same key returns the job already
        dispatched instead of charging again.
    WorkspaceId:
      name: x-workspace-id
      in: header
      required: false
      schema:
        type: string
      description: The workspace this one call acts in, when it is not the key's own.
  schemas:
    Cost:
      type: object
      description: AI credits the call cost.
      additionalProperties: true
    CloudProcessing:
      type: object
      description: Cloud processing the call used, and what is left.
      properties:
        ran_on:
          const: cloud
        minutes:
          type: number
        queued_minutes:
          type: number
        left_minutes:
          type: number
        bought_minutes:
          type: number
        note:
          type: string
    Error:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          const: false
        error:
          type: object
          required:
            - code
            - message
            - retryable
          properties:
            code:
              type: string
            message:
              type: string
              description: What went wrong, in words to act on.
            retryable:
              type: boolean
            suggested_action:
              type: string
              description: The next step that works.
            cloud_processing:
              $ref: '#/components/schemas/CloudProcessing'
  responses:
    Error:
      description: The call was refused or failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        An API key (es_live_…) from Settings, under API keys, or an OAuth access
        token.

````