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

# फ़ाइल अपलोड करें

> बैच प्रोसेसिंग के लिए फ़ाइल अपलोड करें। गेटवे स्वामित्व मेटाडेटा संग्रहीत करता है, ताकि वही वर्कस्पेस बाद में फ़ाइल या उसकी सामग्री प्राप्त कर सके।

लौटाए गए `file_id` को सहेजें और इसके साथ दोबारा उपयोग करें:

* `POST /v1/batches`
* `GET /v1/files/{file_id}`
* `GET /v1/files/{file_id}/content`

<Note>
  साझा गेटवे कुंजी पर अभी `GET /v1/files` समर्थित नहीं है, इसलिए फ़ाइल ID लेने का मानक स्थान अपलोड प्रतिक्रिया है।
</Note>


## OpenAPI

````yaml hi/openapi/v1/openapi.localized.yaml POST /files
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    OpenAI-संगत एंडपॉइंट के माध्यम से विभिन्न AI मॉडल तक पहुँचने के लिए एक गेटवे
    API।
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: वैश्विक रूटिंग
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /files:
    post:
      tags:
        - Gateway
      summary: फ़ाइल अपलोड करें
      description: >-
        `/batches/files` का संगतता alias। बैच प्रोसेसिंग के लिए फ़ाइल अपलोड करता
        है और अपस्ट्रीम फ़ाइल मेटाडेटा लौटाता है। `model` दें ताकि AI Stats
        अपस्ट्रीम प्रदाता का अनुमान लगा सके। `model` और `provider` दोनों छोड़ने
        वाले पुराने क्लाइंट के लिए डिफ़ॉल्ट OpenAI है।
      operationId: uploadFile
      parameters:
        - name: model
          in: query
          required: false
          description: अपस्ट्रीम बैच फ़ाइल प्रदाता का अनुमान लगाने के लिए मॉडल ID।
          schema:
            $ref: '#/components/schemas/ModelId'
        - name: provider
          in: query
          required: false
          description: अपस्ट्रीम फ़ाइल अपलोड के लिए उन्नत प्रदाता चयन।
          schema:
            type: string
            enum:
              - openai
              - groq
              - together
              - mistral
        - name: x-ai-stats-provider
          in: header
          required: false
          description: '`provider` क्वेरी पैरामीटर का हेडर विकल्प।'
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadRequest'
      responses:
        '200':
          description: अपलोड की गई फ़ाइल का मेटाडेटा
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResponse'
        '401':
          description: अनधिकृत
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: अपस्ट्रीम प्रदाता की त्रुटि
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ModelId:
      type: string
      description: >-
        मॉडल पहचानकर्ता। यह runtime string है, इसलिए नए जारी हुए मॉडल SDK अपडेट
        की प्रतीक्षा किए बिना उपयोग किए जा सकते हैं।
      example: ai21/jamba-1.5-large
    FileUploadRequest:
      type: object
      required:
        - file
        - purpose
      properties:
        file:
          type: string
          format: binary
        purpose:
          type: string
    FileResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
        bytes:
          type: integer
        created_at:
          type: integer
        filename:
          type: string
        purpose:
          type: string
        status:
          type: string
        status_details:
          type: object
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        ok:
          type: boolean
          example: false
        error:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          example: error_type
        message:
          type: string
          example: Human-readable error message
        description:
          type: string
          example: Additional error details.
        generation_id:
          type: string
          example: G-abc123
        status_code:
          type: integer
          example: 502
        error_type:
          type: string
          enum:
            - user
            - system
          example: system
        error_origin:
          type: string
          enum:
            - user
            - gateway
            - upstream
          example: upstream
        reason:
          type: string
          example: all_candidates_failed
        attempt_count:
          type: integer
          example: 2
        failed_providers:
          type: array
          items:
            type: string
          example:
            - google-ai-studio
            - openai
        failed_statuses:
          type: array
          items:
            type: integer
          example:
            - 403
            - 429
        upstream_error:
          $ref: '#/components/schemas/ErrorUpstreamError'
        failure_sample:
          type: array
          items:
            $ref: '#/components/schemas/ErrorFailureSampleItem'
        provider_failure_diagnostics:
          $ref: '#/components/schemas/ErrorProviderFailureDiagnostics'
        routing_diagnostics:
          $ref: '#/components/schemas/ErrorRoutingDiagnostics'
        provider_candidate_diagnostics:
          $ref: '#/components/schemas/ErrorProviderCandidateDiagnostics'
        provider_enablement:
          $ref: '#/components/schemas/ErrorProviderEnablementDiagnostics'
        missing_pricing_providers:
          type: array
          items:
            type: string
        provider_payment_required_provider:
          type: string
          example: openai
        provider_payment_required_support_notice:
          type: string
          example: >-
            Our upstream provider billing appears to be unavailable. If this
            persists, contact support.
        details:
          type: array
          items:
            type: object
            additionalProperties: true
      additionalProperties: true
    ErrorUpstreamError:
      type: object
      properties:
        code:
          type: string
          nullable: true
          example: PERMISSION_DENIED
        message:
          type: string
          nullable: true
          example: The caller does not have permission.
        description:
          type: string
          nullable: true
        param:
          type: string
          nullable: true
    ErrorFailureSampleItem:
      type: object
      properties:
        provider:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        status:
          type: integer
          nullable: true
        upstream_error_code:
          type: string
          nullable: true
        upstream_error_message:
          type: string
          nullable: true
        upstream_error_description:
          type: string
          nullable: true
        upstream_error_param:
          type: string
          nullable: true
        upstream_payload_preview:
          type: string
          nullable: true
        retryable:
          type: boolean
          nullable: true
      additionalProperties: true
    ErrorProviderFailureDiagnostics:
      type: object
      properties:
        category:
          type: string
          enum:
            - credentials_not_configured
            - credentials_invalid_or_forbidden
            - provider_access_missing
            - region_or_project_restriction
            - model_unavailable_for_endpoint
            - rate_limited
            - server_error
        hint:
          type: string
        provider:
          type: string
          nullable: true
    ErrorRoutingDiagnostics:
      type: object
      properties:
        filterStages:
          type: array
          items:
            type: object
            properties:
              stage:
                type: string
              beforeCount:
                type: integer
              afterCount:
                type: integer
              droppedProviders:
                type: array
                items:
                  type: object
                  properties:
                    providerId:
                      type: string
                      nullable: true
                    reason:
                      type: string
                      nullable: true
                  additionalProperties: true
            additionalProperties: true
      additionalProperties: true
    ErrorProviderCandidateDiagnostics:
      type: object
      properties:
        totalProviders:
          type: integer
        supportsEndpointCount:
          type: integer
        candidateCount:
          type: integer
        droppedUnsupportedEndpoint:
          type: array
          items:
            type: string
        droppedMissingAdapter:
          type: array
          items:
            type: object
            properties:
              providerId:
                type: string
                nullable: true
              endpoint:
                type: string
                nullable: true
            additionalProperties: true
      additionalProperties: true
    ErrorProviderEnablementDiagnostics:
      type: object
      properties:
        capability:
          type: string
        providersBefore:
          type: array
          items:
            type: string
        providersAfter:
          type: array
          items:
            type: string
        dropped:
          type: array
          items:
            type: object
            properties:
              providerId:
                type: string
                nullable: true
              reason:
                type: string
                nullable: true
            additionalProperties: true
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer टोकन से प्रमाणीकरण

````

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