Skip to content

API Overview

Welcome to the Mira API documentation! This section provides an overview of how to interact with our API services, or "flows," to leverage powerful functionalities within your applications. Whether you're integrating simple data retrieval tasks or complex business logic, the Mira API offers a scalable and secure way to enhance your applications.

API Endpoint Structure

All Mira flows can be accessed via a standard HTTPS endpoint format. Here's the basic structure:

https://console.mira.network/v1/@org/flow-name

Where @org/flow-name is the unique identifier for each flow, such as @klok/qna for a question and answer service.

Authentication

Access to the Mira API requires authentication to ensure that your requests are secure. Here’s a brief guide on how to authenticate your API requests:

  1. Obtain Mira API keys: These are available in your Mira account dashboard after registration.
  2. Use the API key in your requests: Authenticate your API calls by including your API key in the request headers.

Example using curl:

bash
curl -X POST https://console.mira.network/v1/@klok/qna \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question": "What is the capital of France?"}'

Request and Response Formats

Request

The input to a flow is typically sent as a JSON payload in a POST request. Each flow expects a specific schema, which you can find detailed in the individual flow documentation.

Example POST payload:

json
{
  "question": "What is the capital of France?",
  "options": ["Paris", "Lyon", "Marseille"]
}

Response

The response from a flow will also be in JSON format. The schema of the response depends on the specific flow.

Example response:

json
{
  "answer": "Paris"
}

Rate Limiting

Mira APIs are rate-limited to ensure fair usage and high availability for all users. Details on the rate limits and how to handle them can be found in our Rate Limiting Guide.

Error Handling

Understanding and handling errors gracefully is crucial for building robust applications. Mira provides detailed error messages and status codes that help you understand and resolve issues that may occur during API interaction. For more on this, see our Error Handling Guide.

Conclusion

The Mira API is designed to be straightforward and flexible, allowing developers to integrate and automate a wide range of services within their applications. We encourage you to explore the various flows available and start integrating them into your projects.

For detailed examples and additional guidance, refer to our specific flow documentation and our advanced topics section.