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

# 생성 시작

> 작업을 시작하고 금액을 잔액에서 묶어요. 성공하면 청구되고, 실패하거나 취소하면 돌려드려요. 같은 `Idempotency-Key`로 다시 보내면 응답에 `Idempotent-Replayed: true`가 붙어요.



## OpenAPI

````yaml /openapi.json post /generations
openapi: 3.1.0
info:
  title: Zet Studio API
  version: 1.0.0
  description: 이미지와 영상을 만드는 API예요. 작업을 시작하고, 끝날 때까지 조회한 뒤, 결과를 받아요.
servers:
  - url: https://api.studio.thezet.io/v1
security: []
tags:
  - name: 모델과 가격
  - name: 생성
  - name: 입력 파일
  - name: 계정
  - name: 웹훅
paths:
  /generations:
    post:
      tags:
        - 생성
      summary: 생성 시작
      description: >-
        작업을 시작하고 금액을 잔액에서 묶어요. 성공하면 청구되고, 실패하거나 취소하면 돌려드려요. 같은
        `Idempotency-Key`로 다시 보내면 응답에 `Idempotent-Replayed: true`가 붙어요.
      operationId: createGeneration
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: 같은 키로 다시 보내면 첫 작업을 돌려주고 다시 청구하지 않아요. 공백 없는 ASCII 255자까지예요.
          schema:
            type: string
            maxLength: 255
        - name: Accept-Language
          in: header
          required: false
          description: '`ko`면 메시지를 한국어로 줘요. 기본은 영어예요.'
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGeneration'
      responses:
        '202':
          description: 작업을 받았어요. `terminal`이 true가 될 때까지 조회해 주세요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '400':
          description: 요청 내용이 잘못됐어요. `details`에 항목별 문제가 있어요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: API 키가 없거나 잘못됐어요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: 잔액이 부족해요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: 이 계정은 아직 API 사용이 승인되지 않았어요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: 찾을 수 없어요. 다른 고객사의 항목도 404예요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: 지금 상태에서는 처리할 수 없어요. `error.code`를 확인해 주세요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: 요청이나 파일이 너무 커요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          description: 지원하지 않는 형식이에요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 호출 한도나 동시 실행 한도를 넘었어요. `retry_after_seconds`만큼 기다린 뒤 다시 보내요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: 지금은 이 모델을 쓸 수 없어요. 잠시 후 다시 시도해 주세요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    CreateGeneration:
      $id: '#/components/schemas/CreateGeneration'
      type: object
      properties:
        model:
          type: string
          minLength: 1
          description: 모델 ID예요. `GET /models`에서 볼 수 있어요.
        prompt:
          description: 만들 내용이에요. 필요한지는 모델의 `inputs.prompt`에 나와 있어요.
          type: string
          maxLength: 10000
        params:
          description: 모델 옵션이에요. 빼면 기본값을 쓰고, 모델에 없는 값은 400으로 거절해요.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
        inputs:
          type: object
          properties:
            images:
              description: 레퍼런스 이미지예요. 업로드 ID나 끝난 작업의 `outputs[].id`를 넣어요.
              maxItems: 64
              type: array
              items:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            start_frame:
              description: 영상의 시작 프레임 이미지예요.
              type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            end_frame:
              description: 영상의 끝 프레임 이미지예요.
              type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          additionalProperties: false
      required:
        - model
      additionalProperties: false
    Generation:
      $id: '#/components/schemas/Generation'
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - canceled
        terminal:
          type: boolean
          description: true면 더 바뀌지 않아요. 이때 조회를 멈추면 돼요.
        model:
          type: string
        model_name:
          type: string
        modality:
          type: string
          enum:
            - image
            - video
            - remix
        prompt:
          description: 삭제한 작업은 null이에요.
          type:
            - string
            - 'null'
        params:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
          description: 실제로 적용한 옵션이에요. 기본값도 들어 있어요.
        price_usd:
          type: string
          pattern: ^\d+\.\d{4}$
          description: 달러 금액이에요. 오차가 없도록 소수 넷째 자리까지 쓴 문자열로 줘요.
        created_at:
          type: string
          description: ISO 8601 시각이에요.
        deleted_at:
          anyOf:
            - type: string
              description: ISO 8601 시각이에요.
            - type: 'null'
          description: 삭제한 시각이에요. 삭제 전에는 null이에요.
        error:
          anyOf:
            - type: object
              properties:
                code:
                  type: string
                  description: >-
                    `content_rejected`면 내용을 바꿔야 하고, `generation_failed`면 그대로 다시
                    시도해도 돼요.
                message:
                  type: string
              required:
                - code
                - message
              additionalProperties: false
            - type: 'null'
          description: '`failed`일 때만 있어요. 금액은 돌려드려요.'
        outputs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                description: 다음 작업의 입력으로 쓸 수 있어요.
              kind:
                type: string
                enum:
                  - image
                  - video
                  - audio
              url:
                type: string
                description: 로그인 없이 열리는 주소예요.
              mime_type:
                type:
                  - string
                  - 'null'
              width:
                type:
                  - number
                  - 'null'
              height:
                type:
                  - number
                  - 'null'
            required:
              - id
              - kind
              - url
              - mime_type
              - width
              - height
            additionalProperties: false
      required:
        - id
        - status
        - terminal
        - model
        - model_name
        - modality
        - prompt
        - params
        - price_usd
        - created_at
        - deleted_at
        - error
        - outputs
      additionalProperties: false
    Error:
      $id: '#/components/schemas/Error'
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: 프로그램에서 구분할 때 쓰는 값이에요.
            message:
              type: string
              description: '사람이 읽는 설명이에요. 기본은 영어이고 `Accept-Language: ko`면 한국어예요.'
            request_id:
              description: 문의할 때 알려 주세요.
              type:
                - string
                - 'null'
            details:
              description: 항목별 문제처럼 더 자세한 내용이에요. 없으면 null이에요.
            retryable:
              type: boolean
              description: 같은 요청을 다시 보내도 되는지 알려줘요.
            retry_after_seconds:
              description: 이만큼 기다린 뒤 다시 보내요. 없으면 null이에요.
              type:
                - number
                - 'null'
          required:
            - code
            - message
            - request_id
            - details
            - retryable
            - retry_after_seconds
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: zet_live_...
      description: '`Authorization: Bearer <API 키>`'
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: '`x-api-key: <API 키>`. 둘 중 하나만 보내요.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.