← Home System Overview Architecture Data Pipeline Health System Usage System Workflows MCP Tools

Data Pipeline — ManyAI

Blueprint · Last updated 2026-05-02

Request Flow

  1. User sends a message in the ManyAI mobile app.
  2. isImageGenRequest() checks for image-related keywords in the prompt.
  3. pickProvider() selects the first available provider from ROUTING_ORDER.
  4. callProvider() sends the API request with a 30-second timeout.
  5. On failure: add the provider to failedProviders and retry up to MAX_RETRIES = 8 with the next provider in ROUTING_ORDER.
  6. If all retries fail, display an error message to the user.

Provider Selection (pickProvider)

  1. Build the available provider set: include all providers with valid API keys; always include Pollinations.
  2. Filter to VISION_PROVIDERS if an image is attached.
  3. First pass: iterate ROUTING_ORDER, preferring providers with bestFor matching the task type.
  4. Second pass: return the first capable provider (fallback to any available if no bestFor match).
  5. Final fallback: return Pollinations if no other providers are available.
  6. Return null if all providers are exhausted.

API Shapes (callProvider.ts)

ProviderMethodEndpointAuthNotes
PollinationsGETtext.pollinations.ai/{encoded_prompt}NoneNo key required; always available
GeminiPOST/models/{model}:generateContentAPI key in URLparts array with inline_data for images
AnthropicPOST/messagesx-api-key headerDifferent body structure from OpenAI
CloudflarePOSTAccount ID embedded in URLKey split on :Key format: accountId:apiToken
All othersPOST/chat/completionsAuthorization: BearerOpenAI-compatible

Request timeout: 30 seconds per attempt.

Error Handling