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

# Edit Image

> Edit images

This is the edit endpoint of the **Grok Image API**.


## OpenAPI

````yaml openapi/en/grokimage.json POST /grok/image/edits
openapi: 3.1.0
info:
  title: Grok Image DOCS
  version: 1.0.0
  description: >-
    The Grok Image API provides efficient image analysis and generation
    capabilities to help developers quickly integrate intelligent image
    functions.
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /grok/image/edits:
    post:
      description: Edit images
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateRequestEdit'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    GenerateRequestEdit:
      type: object
      properties:
        prompt:
          type: string
          description: Prompt
        refer_images:
          type: array
          description: Reference image list, currently only one image is supported
          items:
            type: string
          example:
            - >-
              https://cdn.ttapi.io/grok/2026-03-30/bd61449e07eb46a5ac8870651f374e50.jpg
        'n':
          type: integer
          default: 1
          description: 'Number of images to generate, range: 1 - 4'
          minimum: 1
          maximum: 4
        hook_url:
          type: string
          description: >-
            Callback URL. The system will send a notification to this URL when
            the task is completed or failed. The notification 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 endpoint</a> to query the result
          example: https://example.com/callback
      required:
        - prompt
  responses:
    SuccessResponse:
      description: Request succeeded
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: jobId
            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: >-
        Please go to <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI
        Console</a> to obtain the API key.

````