---
title: "Universal Ai"
method: POST
path: "/v3/universal-ai"
tags: ["universal-ai"]
---

# Universal Ai

`POST /v3/universal-ai`

## Request

- Base URL: `https://api.edenai.run`
- URL: `https://api.edenai.run/v3/universal-ai`
- Auth: HTTP bearer

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); not supported on
  audio/tts or image/face_recognition, since a voice or a face collection belongs
  to one provider
- 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"}
}
```

## Request body

- UniversalAIBody: 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.
  - `tags` unknown
  - `model` string, required: Model in format: feature/subfeature/provider[/model]
  - `provider_params` object, nullable: Native parameters in the provider's own request format, forwarded to the provider alongside `input`. On some features each provider accepts only an allowlist of parameters, and any other returns 400.
  - `input` object, required: Feature-specific input fields, nested here rather than at the top level of the body. The fields accepted for the feature/subfeature named in `model` are its `input_schema`, served by GET /v3/info/{feature}/{subfeature}. Examples: - text/ai_detection: {'text': 'content to analyze'} - ocr/ocr: {'file': '<file ID or URL>', 'language': 'en'} - image/generation: {'text': 'prompt', 'resolution': '1024x1024'} - translation/document_translation: {'file': '<file ID or URL>', 'target_language': 'fr'}
  - `fallbacks` string[]: 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` boolean, nullable: Include raw provider response in the output
  - `output_format` 'full' | 'compact': `compact` trims `output` for LLM and agent callers: base64-encoded media is dropped wherever it appears (the `*_resource_url` download link next to it stays), and so is dense position data such as per-word OCR boxes, table cell boxes and face landmarks; one box per detected item stays. Fields the output schema marks required may therefore be absent. `original_response` is not trimmed. `full` returns the output unchanged. The response echoes the format. Applies to this response only: an async job keeps its full output, so pass `output_format=compact` again when fetching it.

## Response `200`

Successful Response

- UniversalAIResponse: Sync response from universal-ai endpoint. Inherits all fields from base, with status restricted to success/fail.
  - `status` 'success' | 'fail', required: Whether the request succeeded or failed
  - `cost` string, required: Cost in credits for this request
  - `provider` string, required: Provider name that processed the request
  - `feature` string, required: Feature category (e.g., text, ocr, image)
  - `subfeature` string, required: Specific subfeature (e.g., ai_detection, sentiment)
  - `output_format` 'full' | 'compact': Whether `output`, the normalized output, is whole (`full`) or trimmed for LLM callers (`compact`); echoes the request parameter. Unrelated to `original_response`, the raw provider payload behind `show_original_response`.
  - `output` unknown, required
  - `error` object, nullable: Error details from the provider (only present when status is 'fail')
  - `original_response` unknown
  - `edenai_metadata` object, nullable: How the request was served: the attempts in order and which one answered. Only present when the request sends `x-edenai-metadata: enabled`

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/edenai/apis/eden-ai-api-v3.md) - [All operations](https://skmtc.dev/edenai/apis/eden-ai-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/edenai/apis/eden-ai-api-v3/revisions/20ddfd49a3f4?raw)
