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

# Universal Ai

> Universal AI endpoint for synchronous non-LLM AI features.

Model format: feature/subfeature/provider[/model]

Supported features:
- text/ai_detection, text/moderation, etc.
- ocr/ocr, ocr/identity_parser, etc.
- image/generation, image/background_removal, etc.

For async features (e.g., audio/speech_to_text_async), use POST /v3/universal-ai/async.

Request body:
- model: Model string in format feature/subfeature/provider[/model]
- input: Feature-specific input parameters
- fallbacks: Optional list of fallback provider strings (max 3)
- provider_params: Optional provider-specific parameters
- show_original_response: Include raw provider response (default: false)

Example:
```json
{
    "model": "text/ai_detection/openai/gpt-4",
    "input": {"text": "Analyze this text"}
}
```



## OpenAPI

````yaml /api-reference/v3-openapi.json post /v3/universal-ai
openapi: 3.1.0
info:
  title: Eden AI API V3
  version: 3.0.0
servers:
  - url: https://api.edenai.run
    description: Production server
security: []
paths:
  /v3/universal-ai:
    post:
      tags:
        - universal-ai
      summary: Universal Ai
      description: >-
        Universal AI endpoint for synchronous non-LLM AI features.


        Model format: feature/subfeature/provider[/model]


        Supported features:

        - text/ai_detection, text/moderation, etc.

        - ocr/ocr, ocr/identity_parser, etc.

        - image/generation, image/background_removal, etc.


        For async features (e.g., audio/speech_to_text_async), use POST
        /v3/universal-ai/async.


        Request body:

        - model: Model string in format feature/subfeature/provider[/model]

        - input: Feature-specific input parameters

        - fallbacks: Optional list of fallback provider strings (max 3)

        - provider_params: Optional provider-specific parameters

        - show_original_response: Include raw provider response (default: false)


        Example:

        ```json

        {
            "model": "text/ai_detection/openai/gpt-4",
            "input": {"text": "Analyze this text"}
        }

        ```
      operationId: universal_ai_v3_universal_ai_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UniversalAIBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UniversalAIResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - AuthBearer: []
components:
  schemas:
    UniversalAIBody:
      properties:
        model:
          type: string
          title: Model
          description: 'Model in format: feature/subfeature/provider[/model]'
          examples:
            - text/ai_detection/openai/gpt-4
            - ocr/ocr/amazon
            - image/generation/google/imagen-3
        provider_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Provider Params
          description: Provider-specific parameters
        input:
          additionalProperties: true
          type: object
          title: Input
          description: >-
            Feature-specific input parameters. Required fields depend on the
            feature/subfeature specified in provider. Examples:

            - text/ai_detection: {'text': 'content to analyze'}

            - text/embeddings: {'texts': ['text1', 'text2']}

            - ocr/ocr: {'file_id': 'abc123', 'language': 'en'}

            - image/generation: {'text': 'prompt', 'resolution': '1024x1024'}

            - translation/document_translation: {'file_id': 'abc123',
            'target_language': 'fr'}
          examples:
            - text: Analyze this text for AI detection
            - dimensions: 512
              texts:
                - text1
                - text2
            - file_id: abc123
              language: en
        fallbacks:
          items:
            type: string
          type: array
          maxItems: 3
          title: Fallbacks
          description: >-
            Fallback providers to try if the primary provider fails, in order.
            Accepted formats:
              - 'provider' or 'provider/model' (e.g. 'amazon', 'openai/gpt-4')
              - full model id (e.g 'text/moderation/google', 'image/generation/minimax/image-01')
        show_original_response:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Show Original Response
          description: Include raw provider response in the output
          default: false
      type: object
      required:
        - model
        - input
      title: UniversalAIBody
      description: |-
        Universal AI request body.

        Model format: feature/subfeature/provider[/model]

        Examples:
            - text/ai_detection/openai/gpt-4
            - ocr/ocr/amazon
            - image/generation/google/imagen-3

        The `input` dict contains feature-specific parameters that are
        validated at runtime based on the parsed feature/subfeature.
    UniversalAIResponse:
      properties:
        status:
          type: string
          enum:
            - success
            - fail
          title: Status
          description: Whether the request succeeded or failed
        cost:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Cost
          description: Cost in credits for this request
        provider:
          type: string
          title: Provider
          description: Provider name that processed the request
        feature:
          type: string
          title: Feature
          description: Feature category (e.g., text, ocr, image)
        subfeature:
          type: string
          title: Subfeature
          description: Specific subfeature (e.g., ai_detection, sentiment)
        output:
          title: Output
          description: Normalized output from the provider
        error:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Error
          description: Error details from the provider (only present when status is 'fail')
        original_response:
          anyOf:
            - {}
            - type: 'null'
          title: Original Response
          description: Raw response from the provider (if show_original_response=true)
      type: object
      required:
        - status
        - cost
        - provider
        - feature
        - subfeature
        - output
      title: UniversalAIResponse
      description: |-
        Sync response from universal-ai endpoint.

        Inherits all fields from base, with status restricted to success/fail.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    AuthBearer:
      type: http
      scheme: bearer

````