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

> ## Agent Instructions
> The Deepshi API is an OpenAI-compatible gateway. Base URL: https://api.deepshi.ai/v1. API keys start with sk-bf- and go in the Authorization: Bearer header. Prefer the official OpenAI SDKs pointed at the Deepshi base URL. Model ids are clean with no provider prefix (e.g. deepshi-3.0, claude-opus-4.8, gpt-5.5). Chat and image requests are synchronous; video and music requests are asynchronous job APIs (create, then poll). Every synchronous response carries usage.cost.total_cost in USD. Do not reference the internal /api/* admin plane or virtual keys.

# Create a video job

> Create an asynchronous video generation job from a text prompt, or from an image when `input_reference` is set (image-to-video). Returns a job with `status: "queued"`; poll `GET /v1/videos/{video_id}` until it is `completed`. Beyond `model` and `prompt`, each model accepts its own parameters such as `resolution`, `duration`, `aspect_ratio`, and `generate_audio`; call `GET /v1/models` to see the ones a model supports. Video is priced per second of output and billed once, on completion; pricing is shown on deepshi.ai.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/videos
openapi: 3.1.0
info:
  title: Deepshi API
  description: >-
    OpenAI-compatible REST API for Deepshi's own models and leading third-party
    models. Authenticate with your Deepshi API key as a bearer token, and
    reference a model by its id (e.g. `deepshi-3.0`, `gpt-4o`) in the `model`
    field.
  version: 1.0.0
servers:
  - url: https://api.deepshi.ai
    description: Deepshi API
security:
  - BearerAuth: []
paths:
  /v1/videos:
    post:
      tags:
        - Videos
      summary: Create a video job
      description: >-
        Create an asynchronous video generation job from a text prompt, or from
        an image when `input_reference` is set (image-to-video). Returns a job
        with `status: "queued"`; poll `GET /v1/videos/{video_id}` until it is
        `completed`. Beyond `model` and `prompt`, each model accepts its own
        parameters such as `resolution`, `duration`, `aspect_ratio`, and
        `generate_audio`; call `GET /v1/models` to see the ones a model
        supports. Video is priced per second of output and billed once, on
        completion; pricing is shown on deepshi.ai.
      operationId: createVideo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
            example:
              model: grok-imagine-video
              prompt: a paper boat drifting down a rain-soaked street at night
              resolution: 480p
              duration: 4
      responses:
        '200':
          description: The created video job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoJob'
              example:
                id: vid_a1b2c3
                object: video
                model: grok-imagine-video
                status: queued
                size: 480p
                seconds: '4'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientQuota'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    VideoGenerationRequest:
      type: object
      description: >-
        Video generation request. `model` and `prompt` are required. The
        remaining fields are optional and model-specific; a model ignores any
        field it does not support. Call `GET /v1/models` for the parameters each
        model accepts. Additional model-specific parameters not listed here may
        also be sent and are forwarded to the model.
      required:
        - model
        - prompt
      additionalProperties: true
      properties:
        model:
          type: string
          description: The video model id. See `GET /v1/models`.
          example: grok-imagine-video
        prompt:
          type: string
          description: Text description of the video to generate.
          example: a paper boat drifting down a rain-soaked street
        input_reference:
          type: string
          description: >-
            A public image URL or `data:` URI. Switches the model to
            image-to-video mode. Only supported models accept it.
        resolution:
          type: string
          description: >-
            Model-specific. Resolution tier such as `480p`, `720p`, `1080p`, or
            `4k`. Allowed values are per model and set the billed price on
            resolution-priced models.
          example: 480p
        duration:
          type: integer
          description: >-
            Model-specific. Clip length in seconds (the billed length). An enum
            for some models, a range for others.
          example: 4
        aspect_ratio:
          type: string
          description: >-
            Model-specific. Aspect ratio such as `16:9` or `9:16`. Some models
            add `auto` in image-to-video mode.
          example: '16:9'
        generate_audio:
          type: boolean
          description: >-
            Model-specific. Generate a soundtrack, on models that support audio.
            The audio tier costs more per second, and each model sets its own
            default.
        negative_prompt:
          type: string
          description: >-
            Model-specific. What to avoid in the output, on models that support
            it.
        seed:
          type: integer
          description: >-
            Model-specific. Seed for reproducible output. Omit for a random
            seed.
    VideoJob:
      type: object
      description: A video generation job.
      properties:
        id:
          type: string
          description: The job id. Pass it to the retrieve, content, and delete endpoints.
        object:
          type: string
          description: Object type, always `video`.
          example: video
        model:
          type: string
          description: The video model id you requested.
        status:
          type: string
          enum:
            - queued
            - in_progress
            - completed
            - failed
          description: Lifecycle state of the job.
        size:
          type: string
          description: The resolution the job bills at.
        seconds:
          type: string
          description: The clip length the job bills at, in seconds.
        created_at:
          type: integer
          format: int64
          description: Unix timestamp when the job was created.
        completed_at:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp when the job completed.
        videos:
          type: array
          items:
            $ref: '#/components/schemas/VideoOutput'
          description: The generated video, present when `status` is `completed`.
        error:
          type: object
          nullable: true
          description: >-
            Present when `status` is `failed`. Explains the failure; the job is
            not charged.
          properties:
            code:
              type: string
            message:
              type: string
    VideoOutput:
      type: object
      properties:
        type:
          type: string
          description: Output kind, always `url`.
          example: url
        url:
          type: string
          description: Direct link to the finished `.mp4`.
        content_type:
          type: string
          description: Media type, always `video/mp4`.
    Error:
      type: object
      description: Error envelope, matching the OpenAI shape.
      required:
        - error
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable description of the error.
            type:
              type: string
              description: >-
                Error category, e.g. `invalid_request_error` or
                `insufficient_quota`.
            code:
              type: string
              nullable: true
              description: >-
                Machine-readable error code, e.g. `invalid_api_key`,
                `model_not_found`, `insufficient_quota` (may be null).
            param:
              type: string
              nullable: true
              description: The request parameter the error relates to, when applicable.
  responses:
    BadRequest:
      description: Malformed request, or a model id that doesn't exist in the catalog.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: The model does not exist or you do not have access to it.
              type: invalid_request_error
              code: model_not_found
              param: null
    Unauthorized:
      description: Missing, malformed, or unknown API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Incorrect API key provided.
              type: invalid_request_error
              code: invalid_api_key
              param: null
    InsufficientQuota:
      description: The account is out of credits.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: You have insufficient credits to complete this request.
              type: insufficient_quota
              code: insufficient_quota
              param: null
    Forbidden:
      description: The key is revoked, or not permitted to use the requested model.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: The model does not exist or you do not have access to it.
              type: invalid_request_error
              code: model_not_found
              param: null
    RateLimited:
      description: Too many requests. Back off and retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Rate limit reached. Please retry after a short delay.
              type: rate_limit_error
              code: rate_limit_exceeded
              param: null
    InternalError:
      description: Temporary server error. Retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                The server had an error while processing your request. Please
                retry.
              type: api_error
              code: null
              param: null
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Your Deepshi API key, sent as `Authorization: Bearer <key>`.'

````