TrueFoundry Images API

Image generation and manipulation

OpenAPI Specification

truefoundry-images-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: TrueFoundry AI Gateway Audio Images API
  description: The TrueFoundry AI Gateway API is an OpenAI-compatible proxy layer providing unified access to 1000+ language models across 30+ providers through a single endpoint. It supports chat completions, embeddings, image generation, audio processing, batch operations, file management, content moderation, and model management. The gateway provides centralized authentication, rate limiting, budget controls, observability, and MCP server orchestration.
  version: 1.0.0
  contact:
    name: TrueFoundry Support
    url: https://www.truefoundry.com/
    email: support@truefoundry.com
  termsOfService: https://www.truefoundry.com/privacy-policy
servers:
- url: https://app.truefoundry.com/api/llm
  description: TrueFoundry AI Gateway (default control plane)
- url: https://{control_plane_url}/api/llm
  description: Self-hosted TrueFoundry control plane
  variables:
    control_plane_url:
      default: app.truefoundry.com
      description: Your TrueFoundry control plane URL
security:
- BearerAuth: []
tags:
- name: Images
  description: Image generation and manipulation
paths:
  /images/generations:
    post:
      summary: Generate Images
      description: Generate images from text prompts.
      operationId: generateImages
      tags:
      - Images
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
      responses:
        '200':
          description: Generated images
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    BadRequest:
      description: Bad request - invalid parameters
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                  type:
                    type: string
                  code:
                    type: string
    Unauthorized:
      description: Unauthorized - invalid or missing API key
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                  type:
                    type: string
  schemas:
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
        data:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
              b64_json:
                type: string
              revised_prompt:
                type: string
    ImageGenerationRequest:
      type: object
      required:
      - prompt
      - model
      properties:
        model:
          type: string
          description: Image generation model identifier
        prompt:
          type: string
          description: Text description of the image to generate
        n:
          type: integer
          minimum: 1
          maximum: 10
          default: 1
        size:
          type: string
          enum:
          - 256x256
          - 512x512
          - 1024x1024
          - 1792x1024
          - 1024x1792
        quality:
          type: string
          enum:
          - standard
          - hd
        response_format:
          type: string
          enum:
          - url
          - b64_json
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: TrueFoundry API key (JWT format)