Skip to main content

Overview

MuleRouter is an All In One API service for Creators. In a single agent, you may need a variety of services, such as:
  • Use GPT models to generate text
  • Use Claude models to generate code
  • Use Gemini to generate images
  • Use Midjourney to generate videos
  • Use Tavily to retrieve information
With MuleRouter, you can easily call APIs from multiple model providers, No need to register multiple accounts or manage multiple API tokens, just ONE API key is all you need. Whether it’s a large language model, an image generation model, or an AI-powered tool, everything can be accessed and used here with ease. Meanwhile, MuleRun negotiates higher-tier service levels with providers through aggregated purchasing, delivering more stable and efficient service.

Providers

All providers are exposed under the /vendors path, which distinguishes services by provider. For example, /vendors/openai serves OpenAI models, and /vendors/anthropic serves Anthropic models. For easier discovery, this documentation groups endpoints by practical use cases. Choose the category that best fits your needs.

Endpoints

For most providers, we offer the same endpoints as upstream to simplify integration. For instance, /vendors/openai/v1/chat/completions exposes OpenAI’s v1/chat/completions endpoint.

Alias

For convenience and compatibility, we provide a small number of widely used industry aliases. For example, https://api.mulerun.com/v1/chat/completions is an alias of https://api.mulerun.com/vendors/openai/v1/chat/completions. Currently available aliases:
AliasSource
/v1/chat/completions/vendors/openai/v1/chat/completions
/v1/models/vendors/openai/v1/models
/v1/messages/vendors/anthropic/v1/messages

Authentication

All endpoints require authentication via an API key (token). You can create API keys in MuleRun Creator Studio. See Quick Start for details. Include the Authorization HTTP header in each request:
Authorization: Bearer <API Key>
In a cURL request, the header looks like this:
curl https://api.mulerun.com/v1/chat/completions  \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <Your API Token>" \

Requests and responses

Requests

For most synchronous and streaming endpoints, you can simply switch the endpoint base URL with minimal or no changes to your code or workflow. Our request and response schemas closely follow the upstream providers.

Responses

Asynchronous tasks

For longer-running jobs, we execute via an asynchronous task system. After submitting a task, you receive a task ID that you can use to query status and retrieve results. For more details, see Asynchronous Tasks.

Traceparent

In the response header, you will receive a Traceparent header, this header is used to trace the request and response. If you encounter any issues with your request, please include the Traceparent ID when submitting a bug report to help us resolve the problem as quickly as possible.

Error handling

Errors are reflected in the returned HTTP status code. For example, if your request contains invalid parameters, you will receive 400 Bad Request. The response body includes a JSON object compliant with RFC 9457, containing a MuleRouter error code and message. For more information, see Error Codes.