# Example Projects
Source: https://docs.mira.network/examples/examples
Explore sample projects built with Mira Flows
Discover practical implementations of Mira Flows through our curated collection of example projects. Each example includes complete source code and demonstrates different aspects of the platform.
Complete implementation showing how to integrate and use pre-built flows from the Mira Flows marketplace.
Step-by-step example of creating and deploying custom flows using the Mira Flows SDK.
Example project demonstrating dataset creation, management, and RAG integration with flows.
# Video Tutorials
Source: https://docs.mira.network/examples/tutorials
Learn Mira Flows through step-by-step video guides
Get started with Mira Flows through our comprehensive video tutorials. Each tutorial provides a detailed walkthrough of key platform features and implementation steps.
Learn how to discover, integrate, and use pre-built flows from the Mira Flows marketplace in your applications.
Follow along to create your first custom flow using the Mira Flows SDK and deploy it to the marketplace.
Step-by-step guide to creating and configuring datasets for enhanced RAG capabilities.
# Compound Flows
Source: https://docs.mira.network/flows/core-concepts/compound-flows
Step-by-step guide to installing and setting up Mira Flows SDK for your project
A Compound Flow is an advanced flow type designed for complex, multi-stage processing pipelines. Unlike Elemental Flows which perform single, focused tasks, Compound Flows can create sophisticated decision trees, implement custom processing logic, and orchestrate multiple processing stages. 🎯
## Compound Flow Attributes
### Version ⚡
| Component | Description | Required | Example |
| --------- | ---------------------------------------------------- | -------- | --------- |
| version | Flow specification version using semantic versioning | Yes | `"0.1.0"` |
### Metadata
| Component | Description | Required | Example |
| ----------- | --------------------------------- | -------- | ------------------------------------ |
| flow\_type | Type of flow (must be "compound") | Yes | `"compound"` |
| name | Unique identifier for the flow | Yes | `"your-flow-name"` |
| description | Explanation of flow's purpose | Yes | `"A brief description of your flow"` |
| author | Creator's username | Yes | `"your-username"` |
| tags | Keywords for categorization | No | `[tag1, tag2, tag3]` |
| private | Access control setting | Yes | `false` |
### Input Configuration
| Component | Description | Required | Example |
| ----------- | ------------------------------------------ | -------- | ------------------------------- |
| inputs | Map of input parameters | Yes | Collection of input definitions |
| type | Data type of input (currently only string) | Yes | `"string"` |
| description | Purpose of the input | Yes | `"Description of input1"` |
| required | Whether input is mandatory | Yes | `true` or `false` |
| example | Sample input value | No | `"Example value for input1"` |
### Workflow Configuration
Each Compound Flow must define a workflow consisting of multiple processing stages. There are two types of workflow stages:
#### Elemental Stage Configuration
| Component | Description | Required | Example |
| ----------- | ------------------------------------ | -------- | ---------------------- |
| type | Must be "elemental" | Yes | `"elemental"` |
| flow\_name | Reference to existing Elemental Flow | Yes | `"author/flow-name"` |
| inputs | Mapping to flow inputs | Yes | Input mapping object |
| depends\_on | List of dependent stages | No | `["stage1", "stage2"]` |
#### Custom Stage Configuration
| Component | Description | Required | Example |
| ----------- | ------------------------- | -------- | ---------------------------- |
| type | Must be "custom" | Yes | `"custom"` |
| model | LLM configuration | Yes | Model settings object |
| prompt | Processing instructions | Yes | Template with placeholders |
| inputs | Stage input parameters | Yes | Input mapping object |
| dataset | RAG dataset configuration | No | `"author_name/dataset_name"` |
| depends\_on | List of dependent stages | No | `["stage1", "stage2"]` |
### Dependency Configuration
| Component | Description | Required | Example |
| ----------- | -------------------------------------------------- | -------- | ---------------------- |
| depends\_on | List of stages that must complete before execution | No | `["stage1", "stage2"]` |
#### Execution Behavior
* Stages without depends\_on can execute in parallel
* Stages with depends\_on will wait for specified stages to complete
* Multiple stages can depend on the same previous stage
### Output Configuration
| Component | Description | Required | Example |
| ------------ | -------------------------------- | -------- | ---------------------------------------- |
| output.value | List of stage outputs to combine | Yes | `[${stage1.outputs}, ${stage2.outputs}]` |
## Basic Flow Structure
```yaml .yaml theme={null}
# Flow specification version
version: "0.1.0"
# Flow metadata and configuration
metadata:
flow_type: "compound"
name: "your-flow-name"
description: "Describe what this compound flow accomplishes"
author: "your-username"
tags: [tag1, tag2, tag3]
private: true
# Primary input definitions
inputs:
prime_input_1:
type: string
description: "What this input is used for"
required: true
example: "Example value"
prime_input_2:
type: string
description: "Description of this input"
required: false
example: "Example"
# Workflow definition
workflow:
# Elemental Flow stage - starts immediately
first_flow:
type: "elemental"
flow_name: "john_doe/first_elemental_flow"
inputs:
abc: ${inputs.prime_input_1}
xyz: ${inputs.prime_input_2}
# Custom processing stage - starts immediately (parallel to first_flow)
second_flow:
type: "custom"
inputs:
input1: ${inputs.input_name}
model:
provider: "provider-name"
name: "model-name"
prompt: |
Your flow's primary instruction or role...
You can use {input1} placeholders to reference inputs.
# Waits for both first_flow and second_flow to complete
third_flow:
type: "custom"
depends_on: [first_flow, second_flow]
inputs:
input1: ${first_flow.output}
input2: ${second_flow.output}
model:
provider: "provider-name"
name: "model-name"
dataset:
source: "author_name/dataset_name"
prompt: |
Your flow's primary instruction or role...
You can use {input1} and {input2} placeholders to reference inputs.
# Output configuration
output:
value:
- ${first_flow.output}
- ${second_flow.output}
- ${third_flow.output}
# Flow documentation
readme: |
This is a detailed explanation of what your flow does.
### Workflow Overview:
1. **First Flow**: Executes `john_doe/first_elemental_flow` with the provided inputs.
2. **Second Flow**: Runs in parallel with first flow
3. **Third Flow**: Depends on both previous flows, executes after they complete
### Outputs:
- Combined outputs from all flows are returned in order.
```
## Implementation Structure 🛠️
Compound Flows can either define custom processing logic within their workflow or integrate existing Elemental Flows, providing maximum flexibility for solving complex challenges. The workflow allows for:
1. Advanced Decision Making with conditional processing paths 🧠
2. Custom Processing stages with direct model and prompt configurations ⚙️
3. Integration of existing Elemental Flows for reusability 🔄
4. Parallel execution of independent stages ⚡
5. Sequential execution through depends\_on configurations 🔗
6. Flexible input/output mapping between stages 🔀
# Datasets and RAG
Source: https://docs.mira.network/flows/core-concepts/datasets-and-rag
Step-by-step guide to installing and setting up Mira Flows SDK for your project
Datasets in **Mira Flows** support **Retrieval-Augmented Generation (RAG)** to enhance flows with specific knowledge. This capability allows flows to leverage custom knowledge bases for improved accuracy and contextual awareness in their responses. 🤖📈
***
## Dataset Attributes
| **Component** | **Description** | **Required** | **Example** |
| --------------- | ----------------------------- | ------------ | ----------------------------------- |
| **Name** | Unique identifier for dataset | Yes | `"author/dataset_name"` |
| **Description** | Purpose and content overview | Yes | `"Optional description"` |
| **Source Type** | Type of data being added | Yes | `"url"` or `"file_path"` |
| **Source Path** | Location of source data | Yes | `"example.com"` or `"path/to/file"` |
| **Author** | Creator's username | Yes | `"your-username"` |
***
## Supported File Formats
| **Format** | **Description** | **Processing Method** |
| ------------------ | --------------- | ----------------------------------- |
| **PDF (.pdf)** | Document files | Text extraction from document |
| **Markdown (.md)** | Formatted text | Text extraction from document |
| **URL** | Web content | Web content scraping |
| **CSV (.csv)** | URL listings | URL extraction and content scraping |
| **Text (.txt)** | Plain text | Direct text extraction |
***
## Creating and Configuring Datasets
### Creating a Dataset
```python Python theme={null}
from mira_sdk import MiraClient
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"})
# Create dataset
client.dataset.create("author/dataset_name", "Optional description")
```
### Adding Data Sources
```python Python theme={null}
# Add URL to your dataset
client.dataset.add_source("author/dataset_name", url="example.com")
# Add file to your dataset
client.dataset.add_source("author/dataset_name", file_path="path/to/my/file.csv")
```
### Linking Dataset with Flow
Add the following configuration to your `flow.yaml` file:
```yaml .yaml theme={null}
dataset:
source: "author/dataset_name"
```
***
# Elemental Flows
Source: https://docs.mira.network/flows/core-concepts/elemental-flows
Understanding the fundamental building blocks of Mira Flows
An Elemental Flow is a self-contained, autonomous unit designed to perform specific, unique actions. These flows serve as the foundational building blocks within the Mira Flows ecosystem, enabling precise and reliable AI-powered operations.
## Elemental Flow Attributes
### Version
| Component | Description | Required | Example |
| --------- | ---------------------------------------------------- | -------- | --------- |
| version | Flow specification version using semantic versioning | Yes | `"0.0.1"` |
### Metadata
| Component | Description | Required | Example |
| ----------- | ------------------------------ | -------- | ------------------------------------ |
| name | Unique identifier for the flow | Yes | `"your-flow-name"` |
| description | Explanation of flow's purpose | Yes | `"A brief description of your flow"` |
| author | Creator's username | Yes | `"your-username"` |
| tags | Keywords for categorization | No | `[tag1, tag2, tag3]` |
| private | Access control setting | Yes | `false` |
### Input Configuration
Supported Input Types:
| Type | Description |
| ------ | ----------------------- |
| string | Text-based input values |
Input Structure:
| Component | Description | Required | Example |
| ----------- | ------------------------------------------ | -------- | ------------------------------- |
| inputs | Map of input parameters | Yes | Collection of input definitions |
| type | Data type of input (currently only string) | Yes | `"string"` |
| description | Purpose of the input | Yes | `"Description of input1"` |
| required | Whether input is mandatory | Yes | `true` or `false` |
| example | Sample input value | No | `"Example value for input1"` |
### Model Configuration
| Component | Description | Required | Example |
| --------- | ------------------------- | -------- | ----------------- |
| provider | AI service provider | Yes | `"provider-name"` |
| name | Specific model identifier | Yes | `"model-name"` |
### Dataset Configuration (Optional)
| Component | Description | Required | Example |
| --------- | -------------------- | -------- | ---------------------------- |
| source | Reference to dataset | No | `"author_name/dataset_name"` |
### Prompt and Readme Configuration
| Component | Description | Required | Example |
| --------- | ------------------------------- | -------- | --------------------------------------- |
| prompt | Instructions for model behavior | Yes | "Generate a tweet on the given topic: " |
| readme | Usage documentation | Yes | Markdown-formatted guide |
## Basic Flow Structure
The official YAML structure for a basic Mira Flow:
```yaml .yaml theme={null}
version: "your.version.here"
metadata:
name: "your-flow-name"
description: "A brief description of your flow"
author: "your-username"
tags: [tag1, tag2, tag3]
private: false
inputs:
input1:
type: string
description: "Description of input1"
required: true
example: "Example value for input1"
input2:
type: string
description: "Description of input2"
required: true
example: "Example value for input2"
model:
provider: "provider-name"
name: "model-name"
prompt: |
Your flow's primary instruction or role...
You can use {input1} and {input2} placeholders to reference inputs.
readme: |
Your flow's readme...
You can use raw text or markdown here.
```
## RAG Integration 🔍
To integrate RAG capabilities, you'll need to:
1. Create a dataset
2. Add data sources to your dataset
3. Link the dataset to your flow
The following file formats are supported for datasets:
| File Type | Processing Method |
| -------------- | --------------------------------------- |
| PDF (.pdf) | Text extraction from document |
| Markdown (.md) | Text extraction from document |
| URL | Web content scraping |
| CSV (.csv) | URL extraction and content scraping |
| Text (.txt) | Direct text extraction |
| Zip (.zip) | Processing of contained supported files |
### Creating a Dataset 🗃️
```python theme={null}
from mira_sdk import MiraClient
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"})
# Create dataset
client.dataset.create("author/dataset_name", "Optional description")
```
### Adding Data Sources
```python theme={null}
# Add URL to your dataset
client.dataset.add_source("author/dataset_name", url="example.com")
# Add file to your dataset
client.dataset.add_source("author/dataset_name", file_path="path/to/my/file.csv")
```
### Linking Dataset with Flow
Add the following configuration to your flow\.yaml file:
```yaml theme={null}
dataset:
source: "author/dataset_name"
```
### Flow Structure with RAG
The official YAML structure for a flow with RAG capabilities:
```yaml theme={null}
version: "your.version.here"
metadata:
name: "your-flow-name"
description: "A brief description of your flow"
author: "your-username"
tags: [tag1, tag2, tag3]
private: false
inputs:
input1:
type: string
description: "Description of input1"
required: true
example: "Example value for input1"
model:
provider: "provider-name"
name: "model-name"
dataset:
source: "author_name/dataset_name"
prompt: |
Your flow's primary instruction or role...
You can use {input1} placeholders to reference inputs.
readme: |
Your flow's readme...
You can use raw text or markdown here.
```
# Installation
Source: https://docs.mira.network/flows/get-started/installation
Step-by-step guide to installing and setting up Mira Flows SDK for your project
## Account Setup
Sign up for your free Mira Flows account and begin your AI development journey.
Generate your API key from the API section - you'll need this to access Mira Flows features.
## Prerequisites
Mira flows requires **`Python >=3.9, <=3.13`**
```bash theme={null}
# Check your Python version
python3 --version
```
Need to update? Visit [python.org/downloads](https://python.org/downloads)
## Installation Steps
1. Install the SDK using pip:
```bash theme={null}
pip install mira-sdk
```
1. Initialize the client:
```python theme={null}
from mira_sdk import MiraClient
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"})
```
### Using Environment Variables (Recommended)
Install python-dotenv
```bash theme={null}
pip install python-dotenv
```
Create a `.env` file in your project root and add:
```plaintext theme={null}
MIRA_API_KEY=your_api_key_here
```
Then initialize the client using the environment variable:
```python theme={null}
from dotenv import load_dotenv
from mira_sdk import MiraClient
import os
load_dotenv()
client = MiraClient(config={"API_KEY": os.getenv("MIRA_API_KEY")})
```
## Next Steps
Browse available flows to understand the platform's capabilities and start using pre-built solutions.
Follow our guide to build your own custom flow and unlock the full potential of Mira Flows.
# Introduction
Source: https://docs.mira.network/flows/get-started/introduction
Introduction to Mira Flows SDK
## What is Mira Flows SDK?
Mira Flows SDK is a powerful Python toolkit that enables developers to programmatically create, manage, and deploy AI-powered flows. From simple chat interfaces to complex multi-stage AI pipelines, the SDK provides a seamless interface to build sophisticated AI applications by combining Large Language Models (LLMs) with custom knowledge bases and configurable workflows.
## Key Features
Create, test, and deploy AI flows with minimal setup using straightforward YAML configurations - from basic chatbots to complex multi-stage pipelines
Enhance your flows with custom knowledge through easy integration of PDFs, markdown files, URLs, and more for context-aware AI solutions
Discover, use, and customize pre-built flows from our growing marketplace of AI solutions to accelerate development
## SDK Capabilities
* **Simple to Complex**: Build everything from basic Q\&A flows to sophisticated multi-stage processing pipelines
* **Actionable Flows**: Transform your flows into autonomous agents that can interact with external tools and APIs
* **Custom Knowledge Integration**: Enhance flows with domain-specific knowledge through RAG capabilities
* **Flow Composition**: Combine multiple flows to create complex AI workflows and processing chains
* **Extensible Design**: Add custom tools and integrations to expand your flows' capabilities
* **Scalable Architecture**: Handle increasing workloads with built-in scaling capabilities
## Getting Started
Sign up for a Mira Flows account to begin your AI development journey.
Set up the Mira Flows SDK in your development environment.
Discover available flows and explore the possibilities in our marketplace of AI solutions.
Connect with developers, and stay updated through our vibrant Discord community.
Start building powerful AI applications with Mira Flows SDK today! Follow our [installation guide](./installation.md) to begin your journey.
# Models
Source: https://docs.mira.network/flows/get-started/models
Step-by-step guide to installing and setting up Mira Flows SDK for your project
**Mira Flows** provides access to a selection of **Large Language Models (LLMs)** that serve as the computational engine for flows. Each model offers specific capabilities and performance characteristics suitable for different use cases. 🚀✨
***
## Model Attributes
| **Component** | **Description** | **Required** | **Example** |
| -------------- | ------------------------- | ------------ | -------------------------- |
| **Provider** | AI service provider | Yes | `"meta"` |
| **Model Name** | Specific model identifier | Yes | `"llama-3.3-70b-instruct"` |
***
## Available Models
| **Provider** | **Model Name** |
| ------------- | ------------------------ |
| **openai** | `gpt-4o` |
| **anthropic** | `claude-3.5-sonnet` |
| **meta** | `llama-3.3-70b-instruct` |
# Build Compound Flows
Source: https://docs.mira.network/flows/how-to-guides/building-compound-flows
Learn how to build your own compound flow using Mira Flows SDK
This guide explains how to **create, test, and deploy compound flows** that implement complex, multi-stage processing pipelines. **Compound flows** provide sophisticated capabilities for implementing business logic, custom processing stages, and integration with existing **elemental flows**. 🔄💡
## Development Lifecycle
Creating a **compound flow** follows a systematic process:
Let's explore each step in detail.
***
Use **OpenAI (gpt-4o)** or **Anthropic (claude-3.5-sonnet)** models when building complex workflows to ensure optimal performance. Checkout [Available Models](documentation/get-started/models)
## Step 1: YAML Configuration
```yaml .yaml theme={null}
# Flow specification version
version: "0.1.0" # Flow specification version
metadata:
flow_type: "compound" # Specifies this as a compound flow
name: "your-flow-name" # Unique identifier
description: "Describe what this compound flow accomplishes"
author: "your-username" # Your Mira Flows username
tags: [tag1, tag2, tag3] # Discovery keywords
private: true # Access control setting
inputs:
prime_input_1: # Primary input parameter
type: string
description: "What is this input used for"
required: true
example: "Example value"
prime_input_2: # Secondary input parameter
type: string
description: "Description of this input"
required: false
example: "Example"
workflow:
# Elemental Flow stage - starts immediately
first_flow: # First processing stage
type: "elemental"
flow_name: "john_doe/first_elemental_flow"
inputs:
abc: ${inputs.prime_input_1}
xyz: ${inputs.prime_input_2}
# Custom processing stage - starts immediately (parallel to first_flow)
second_flow: # Parallel processing stage
type: "custom"
inputs:
input1: ${inputs.prime_input_1}
model:
provider: "provider-name" # e.g., anthropic, openai, meta, etc.
name: "model-name" # Specific model identifier
prompt: |
Your flow's primary instruction or role...
You can use {input1} placeholders to reference inputs.
# Waits for both first_flow and second_flow to complete
third_flow:
type: "custom"
depends_on: [first_flow, second_flow] # Dependent on fist_flow and second_flow
inputs:
input1: ${first_flow.output} # uses output of first_flow as input
input2: ${second_flow.output} # uses output of second_flow as input
model:
provider: "provider-name"
name: "model-name"
dataset:
source: "author_name/dataset_name"
prompt: |
Your flow's primary instruction or role...
You can use {input1} and {input2} placeholders to reference inputs.
output:
value: # Combine & customise outputs in order
- ${first_flow.output}
- ${second_flow.output}
- ${third_flow.output}
readme: |
This is a detailed explanation of what your flow does.
### Workflow Overview:
1. **First Flow**: Executes `john_doe/first_elemental_flow` with the provided inputs
2. **Second Flow**: Runs in parallel with first flow
3. **Third Flow**: Depends on both previous flows, executes after they complete
### Outputs:
- Combined outputs from all flows are returned in order
```
***
## Step 2: Testing
**Test your compound flow** to ensure all stages work correctly:
```python Python theme={null}
from mira_sdk import MiraClient, CompoundFlow
from mira_sdk.exceptions import FlowError
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"}) # Initialize Mira Client
flow = CompoundFlow(source="/path/to/compound_flow.yaml") # Load flow configuration
test_input = { # Prepare test inputs
"prime_input_1": "test data",
"prime_input_2": "test parameters"
}
try:
response = client.flow.test(flow, test_input) # Test entire pipeline
print("Test response:", response)
except FlowError as e:
print("Test failed:", str(e)) # Handle test failure
```
***
## Step 3: Deployment
**Deploy your compound flow** to make it available:
```python Python theme={null}
from mira_sdk import MiraClient, CompoundFlow
from mira_sdk.exceptions import FlowError
flow = CompoundFlow(source="/path/to/compound_flow.yaml") # Load flow configuration
try:
client.flow.deploy(flow) # Deploy to platform
print("Compound flow deployed successfully!") # Success message
except FlowError as e:
print(f"Deployment error: {str(e)}") # Handle deployment error
```
***
## Step 4: Execution
After deployment, **execute your compound flow**:
```python Python theme={null}
from mira_sdk import MiraClient
from mira_sdk.exceptions import FlowError
flow_name = "your-username/your-flow-name" # Flow identifier
input_data = { # Execution inputs
"prime_input_1": "production data",
"prime_input_2": "production parameters"
}
try:
result = client.flow.execute(flow_name, input_data) # Execute workflow
print("Execution result:", result) # Display result
except FlowError as e:
print("Execution error:", str(e)) # Handle execution error
```
***
## Step 5: Updates
When you need to **modify your compound flow**:
```python Python theme={null}
from mira_sdk import MiraClient
from mira_sdk.exceptions import FlowError
flow = client.flow.get("your-username/your-flow-name") # Retrieve existing flow
flow.save("/path/to/compound_flow.yaml") # Save for editing
try:
client.flow.deploy(flow) # Deploy updated version
print("Updated flow deployed successfully!") # Success message
except FlowError as e:
print(f"Update error: {str(e)}") # Handle update error
# In case you forget to bump the flow version, it will get bumped by default every time you deploy the same flow.
```
By following these steps, you can **create, test, deploy, and manage** your own **custom compound flows** on the **Mira Flows** platform. 🌟🔧
# Build Elemental Flows
Source: https://docs.mira.network/flows/how-to-guides/building-elemental-flows
Learn how to build your own elemental flow using Mira Flows SDK
## Video Tutorial
Check out this Github Repository for a quick overview on how to build an Elemental Flow.
This guide explains how to **create, test, and deploy elemental flows** that implement focused, single-task processing. **Elemental flows** provide core functionality that can be used independently or as building blocks within compound flows. 🔄💡
## Development Lifecycle
Creating an **elemental flow** follows a systematic process:
Let's explore each step in detail.
***
## Step 1: YAML Configuration
```yaml .yaml theme={null}
# Version format ex. "0.0.1"
version: "your.version.here" # Flow specification version
# Basic metadata for the agent
metadata:
name: "your-flow-name" # Unique identifier
description: "A brief description of your flow" # Flow purpose
author: "your-username" # Must match your account username
tags: [tag1, tag2, tag3, ...] # Keywords for categorization
private: false # Access control setting
# Define the input variables required
inputs:
input1: # First input parameter
type: string # Currently only String format
description: "Description of input1"
required: true
example: "Example value for input1"
input2: # Second input parameter
type: string
description: "Description of input2"
required: true
example: "Example value for input2"
# LLM configuration
model:
provider: "provider-name" # e.g., anthropic, openai, meta, etc.
name: "model-name" # Specific model identifier
# Dataset configuration (Optional)
dataset:
source: "author_name/dataset_name" # Make sure this dataset exists
# Prompt template configuration
prompt: |
Your flow's primary instruction or role...
You can use {input1} and {input2} placeholders to reference inputs.
# ReadME configuration
readme: |
Your flow's readme...
You can use raw text or markdown here.
```
***
## Step 2: Testing
**Test your elemental flow** before deployment:
```python Python theme={null}
from mira_sdk import MiraClient, Flow
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"}) # Initialize Mira Client
# Basic test
flow = Flow(source="/path/to/your.yaml") # Load flow configuration
input_dict = {"key": "value"} # Prepare test input
response = client.flow.test(flow, input_dict) # Test flow
```
***
## Step 3: Deployment
**Deploy your elemental flow** to make it available:
```python Python theme={null}
from mira_sdk import MiraClient, Flow
from mira_sdk.exceptions import FlowError
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"}) # Initialize client
flow = Flow(source="/path/to/your.yaml") # Load flow
try:
client.flow.deploy(flow) # Deploy to platform
except FlowError as e:
print(f"Error occurred: {str(e)}") # Handle deployment error
```
***
## Step 4: Execution
After deployment, **execute your elemental flow**:
```python Python theme={null}
from mira_sdk import MiraClient, Flow
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"}) # Initialize client
version = "1.0.0" # Optional specific version
input_data = {"key": "value"} # Execution input
# If no version is provided, it'll use the latest version by default
if version:
flow_name = f"author/your-flow-name/{version}"
else:
flow_name = "author/your-flow-name"
result = client.flow.execute(flow_name, input_data) # Execute flow
print(result)
```
***
## Step 5: Updates
When you need to **modify your elemental flow**:
```python Python theme={null}
from mira_sdk import Flow, MiraClient
from mira_sdk.exceptions import FlowError
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"}) # Initialize client
# Load existing flow
flow = client.flow.get("author/flow_name") # Get current version
flow.save("/path/to/flow.yaml") # Save for editing
# Deploy updated flow
try:
client.flow.deploy(flow) # Deploy new version
except FlowError as e:
print(f"Error occurred: {str(e)}") # Handle update error
# In case you forget to bump the flow version, it will get bumped by default every time you deploy the same flow.
```
By following these steps, you can **create, test, deploy, and manage** your own **custom elemental flows** on the **Mira Flows** platform. This process allows you to **contribute to the Marketplace** and **continuously improve** your flows over time. 🌟🔧
### Example
Complete example showcasing how to build and customize your own
elemental flows from scratch.
# Turn flows into Actionable Agents
Source: https://docs.mira.network/flows/how-to-guides/empowering-flows-with-actions
Use the Composio tool integration to turn flows into Actionalble Agents
Composio allows you to connect your Mira Flows with various external services and platforms, enabling automated actions based on your flow outputs. This integration bridges the gap between AI-powered flows and real-world actions.
Composio tool requires Anthropic Claude-3.5-sonnet to function. Check out [Models](/documentation/get-started/models) for more information.
## Step-by-Step Integration Guide
### 1. Set Up Platform Integration
First, let's set up your desired platform integration in Composio:
1. Visit [Composio](https://composio.dev/)
2. Sign in to your account & Navigate to "All Tools"
3. Search for your desired integration (e.g., Twitter, Discord, Telegram)
4. Complete the integration process and authorise your account
### 2. Obtain Integration Details
After setting up the integration, you'll need 3 key pieces of information:
1. **API Key**:
* Go to your Composio dashboard
* Look for the API key section at top and copy your API key.
* You can use the default API key or create a new one
2. **Enum**:
* Go to the actions of the app you want to integrate with
* Copy the "Enum" of the action you wish to perform
3. **Entity ID**:
* This is generated after you complete the platform integration
* Find it in your "connected accounts" section under tools
### 3. Step by Step Demo
Here's an interactive demo showing the process:
## Code Implementation
### ComposioConfig Attributes
| Attribute | Description | Required |
| ------------------ | ----------------------------------------------------------------- | -------- |
| COMPOSIO\_API\_KEY | Your Composio authentication key | Yes |
| ACTION | Platform-specific action (e.g., "TWITTER\_POST", "DISCORD\_SEND") | Yes |
| TASK | Natural language description including `{content}` placeholder | Yes |
| ENTITY\_ID | Platform-specific entity identifier | Yes |
### Code Example
```python theme={null}
from mira_sdk import MiraClient, Flow, ComposioConfig
# Initialize Mira client with your API key
client = MiraClient(config={"API_KEY": "YOUR_MIRA_API_KEY"})
# Get your exisitng flow
version = "1.0.0"
input_data = {"key": "value"}
# If no version is provided, latest version is used by default
if version:
flow = f"author/your-flow-name/{version}"
else:
flow = "author/your-flow-name"
# Set up your flow's input parameters
input_dict = {
"input": "value"
}
# Execute flow with Composio integration
# The flow's output will automatically replace {content} in the TASK
response = client.flow.execute(
flow,
input_dict,
ComposioConfig(
COMPOSIO_API_KEY="YOUR_COMPOSIO_API_KEY",
ACTION="ENUM", # This is the Enum e.g., "TWITTER_POST", "DISCORD_SEND"
TASK="Describe your task in natural language - {content}", # {content} is required and gets replaced with flow output
ENTITY_ID="YOUR_ENTITY_ID" # Platform-specific identifier
)
)
```
### What Not to Do
1. Don't forget `{content}` in TASK:
```python theme={null}
# ❌ Incorrect - missing {content}
TASK="Post this message"
# ✅ Correct
TASK="Post this message: {content}"
```
1. Don't modify the `{content}` placeholder:
```python theme={null}
# ❌ Incorrect
TASK="Send {message}"
TASK="Post {text}"
# ✅ Correct
TASK="Send {content}"
```
1. Don't use multiple `{content}` placeholders:
```python theme={null}
# ❌ Incorrect
TASK="Post {content} and then {content}"
# ✅ Correct
TASK="Post {content}"
```
# Implement RAG Capabilities
Source: https://docs.mira.network/flows/how-to-guides/implementing-rag-capabilities
Learn how to enhance your flows with Retrieval-Augmented Generation (RAG) using Mira Flows SDK
## Video Tutorial
Check out this Github Repository for a quick overview on how to Implement RAG Capabilities.
### Understanding RAG Implementation
**Retrieval-Augmented Generation (RAG)** enhances your flows with specific domain knowledge. The implementation process involves three main stages:
1. 🗂️ **Create a Dataset**: Establish a knowledge base that contains specialized information your flow will reference during execution.
2. ➕ **Add Data Sources**: Populate your dataset with relevant information from various supported sources.
3. 🔗 **Link Dataset to Flow**: Connect the dataset to your flow, enabling it to leverage this information during processing.
### Creating Your Dataset
Begin by establishing your knowledge base:
```python Python theme={null}
from mira_sdk import MiraClient
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"}) # Initialize client
# Create a new dataset
client.dataset.create(
"author/dataset_name", # Unique identifier
"Description of your knowledge base" # Dataset purpose
)
```
### Adding Data Sources
Populate your dataset with information from various supported formats:
```python Python theme={null}
# Add a PDF document as data source
client.dataset.add_source("author/dataset_name", file_path="document.pdf")
# Add and URL as data source
client.dataset.add_source("author/dataset_name", url="https://example.com/data")
# Add multiple URL sources via a CSV file
client.dataset.add_source("author/dataset_name", file_path="sources.csv")
```
### Linking Dataset to Flow
Connect your dataset to an existing flow by modifying its configuration:
```yaml .yaml theme={null}
# Additional flow configuration with RAG
dataset:
source: "author/dataset_name" # Link to your dataset
# Rest of your flow configuration remains unchanged
```
### Example
Complete example showcasing how to set up and configure datasets for
Retrieval Augmented Generation (RAG) capabilities.
# Save and Customize Marketplace Flows
Source: https://docs.mira.network/flows/how-to-guides/saving-&-customising-marketplace-flows
Learn how to save flows from the marketplace and customize them according to your specific requirements
This guide explains how to **save flows from the marketplace** and **customize them** according to your specific requirements. 🛠️✨
***
## Saving a Flow
When you find a useful flow in the **Marketplace**, you can **save it locally** for customization:
```python Python theme={null}
from mira_sdk import MiraClient
# Initialize client
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"})
# Get the flow you want to customize
flow = client.flow.get("author/flow_name")
# Save to local YAML file
flow.save("/path/to/flow.yaml")
```
***
## Customizing Your Flow
After saving the flow locally, you can **modify the YAML file** according to your needs. Here are the **key areas** you can customize:
### Modifying Metadata
Update the flow's basic information to reflect your ownership and purpose:
```yaml .yaml theme={null}
metadata:
name: "your-customized-flow-name" # Rename flow
description: "Your modified description" # Flow description
author: "your-username" # Your Mira Flows username
tags: [your, custom, tags] # Discovery keywords
private: true # Access control setting (true/false)
```
### Adjusting Inputs
Modify input parameters to match your requirements:
```yaml .yaml theme={null}
inputs:
custom_input:
type: string # Input type
description: "Your custom input description" # Input description
required: true # Required field
example: "Your example value" # Example value
```
### Updating the Prompt
Customize the prompt to achieve your desired output:
```yaml .yaml theme={null}
prompt: |
Your customized instructions...
You can use {custom_input} as a placeholder
```
### Modifying Model Settings
Change the model configuration if needed:
```yaml .yaml theme={null}
model:
provider: "provider-name" # AI service provider
name: "your-preferred-model" # Specific model identifier
```
***
## Testing Your Customized Flow
Before deployment, **test your modifications** to ensure everything works correctly:
```python Python theme={null}
from mira_sdk import Flow
# Load your modified flow
modified_flow = Flow(source="/path/to/flow.yaml")
# Test with sample inputs
test_input = {"custom_input": "test value"}
response = client.flow.test(modified_flow, test_input)
```
***
## Deploying Your Custom Flow
Once you're satisfied with the modifications:
```python Python theme={null}
# Deploy as your own flow
client.flow.deploy(modified_flow)
```
For more detailed information about **customization options** and **best practices**, please refer to our complete **documentation** 📖🔗.
# Use Marketplace Flows
Source: https://docs.mira.network/flows/how-to-guides/using-marketplace-flows
Learn how to discover, integrate, and customize pre-built flows from the Mira Flows Marketplace
## Video Tutorial
Check out this Github Repository for a quick overview on how to use Marketplace Flows.
**Mira Flows** offers a **Marketplace** where you can explore and use a variety of pre-built flows. There are two primary ways to utilize these flows:
1. 🛠️ **Using the Mira Flows SDK**
2. 🌐 **Direct API calls (without the SDK)**
***
## Exploring the Marketplace
To discover available flows:
1. 🚀 **Navigate to the** [**Marketplace**](https://console.mira.network/)
2. 🔎 **Browse or search for flows that fit your needs**
***
## Using Flows via the SDK
```python Python theme={null}
from mira_sdk import MiraClient, Flow
# Initialize the client
client = MiraClient(config={"API_KEY": "YOUR_API_KEY"})
version = "1.0.0"
input_data = {"key": "value"}
# If no version is provided, latest version is used by default
if version:
flow_name = f"author/your-flow-name/{version}"
else:
flow_name = "author/your-flow-name"
result = client.flow.execute(flow_name, input_data)
print(result)
```
***
## Flow Management via SDK
```python Python theme={null}
from mira_sdk import MiraClient, Flow
# Get a flow
flow = client.flow.get("author/flow_name")
# Get flows by author
flows = client.flow.get_by_author("author")
# Get flows by tag
flows = client.flow.get_by_tag("tag")
# Search for flow
flows = client.flow.search("abcd")
```
***
## Direct API Calls (Without SDK)
For those who prefer not to use the SDK or are working in other programming languages, you can interact with flows directly via API calls:
1. 🔍 **Find the flow you want to use in the marketplace and view its API documentation.**
2. 📡 **Use the flow's API endpoint in your HTTP requests**
```terminal Terminal theme={null}
curl --request POST \
--url https://console-bff.stg.arohalabs.dev/v1/flows/flows/{author}/{flow_name} \
--header 'MiraAuthorization: YOUR_API_KEY' \
--data '{
"input_param": "value"
}'
```
Replace `YOUR_API_KEY`, `author`, and `flow_name` with your actual API key, author name, and flow name, and adjust the endpoint and payload structure according to the specific flow's requirements.
**Response**:
```json .json theme={null}
{
"result": "LLM output"
}
```
### Example
Complete example showcasing how to integrate and use Marketplace flows
in your applications.
# Checking Credits
Source: https://docs.mira.network/network/credit-operations/getting-credit
Check your Mira Network credit balance and monitor usage with the Python SDK's get_user_credits() method to avoid service interruptions.
## Credit Information
Monitor your current credit balance and usage using the `get_user_credits()` method.
### Example
```python theme={null}
from mira_network import MiraClient
async def check_credits():
async with MiraClient(api_key="your-api-key") as client:
credits = await client.get_user_credits()
print("Credits:", credits)
```
### Response Structure
```python theme={null}
{
"credits": 150.75 # Current balance in USD
}
```
### Usage Notes
* Credits are consumed per request, based on the model and token usage.
* See per-transaction detail with [`get_credits_history()`](/network/credit-operations/viewing-credit-history) or in the [Mira Console](https://console.mira.network/credit-history).
# Credit History
Source: https://docs.mira.network/network/credit-operations/viewing-credit-history
Track your credit usage over time
## Credit History
Track your credit usage and transactions over time using the `get_credits_history()` method.
### Example
```python theme={null}
from mira_network import MiraClient
async def view_credit_history():
async with MiraClient(api_key="your-api-key") as client:
history = await client.get_credits_history()
# Transactions are under "items"
for transaction in history["items"]:
print(f"{transaction['amount']}: {transaction['description']}")
```
### Response Structure
`get_credits_history()` returns a paginated object; transactions are in `items`. Usage is recorded as a **negative** `amount` (a debit), credit top-ups as positive:
```python theme={null}
{
"items": [
{
"id": "0568480b-8fca-4bea-a8c3-325c75736710",
"user_id": "kS5ltHsyLQIy5TVEua4NN6Nv3sQEQrXK",
"amount": -0.0000024, # USD (negative = usage)
"description": "AI usage: gpt-4o-mini (12+1 tokens)",
"created_at": "2026-01-01T00:00:00.000Z"
}
# ... more transactions
],
"total": 1,
"page": 1,
"page_size": 10,
"total_pages": 1
}
```
### Visual Analytics
For detailed credit usage analytics and visualizations:
1. Visit [Mira Console Credit History](https://console.mira.network/credit-history)
2. View usage patterns, trends, and detailed breakdowns
# Installation
Source: https://docs.mira.network/network/get-started/installation
Install and configure Mira Network SDK for your project
## Prerequisites
Before installing the SDK, ensure you have:
* Python 3.8 or higher installed
* pip package manager
* A Mira Network API key (get one at [console.mira.network](https://console.mira.network))
## Installation Steps
### Step 1: Install via pip
Install the SDK using pip:
```bash theme={null}
pip install mira-network
```
### Step 2: Verify Installation
Verify the installation:
```bash theme={null}
pip show mira-network
```
### Step 3: Environment Configuration
Configure your environment:
```python theme={null}
import os
from mira_network import MiraClient
client = MiraClient(
api_key=os.getenv("MIRA_API_KEY"),
base_url=os.getenv("MIRA_API_URL", "https://api.mira.network")
)
```
### Step 4: Test Your Setup
Create a simple test script:
```python theme={null}
from mira_network import MiraClient
async def test_setup():
async with MiraClient(api_key="your-api-key") as client:
models = await client.list_models()
print("Available models:", models)
if __name__ == "__main__":
import asyncio
asyncio.run(test_setup())
```
## Next Steps
Once installed, proceed to the [Quickstart](/network/get-started/quickstart) guide to make your first API call.
# Introduction
Source: https://docs.mira.network/network/get-started/introduction
Introduction to Mira Network SDK
## What Is Mira Network?
Mira Network SDK is your unified interface to the world of AI language models, providing a seamless way to integrate multiple language models while offering advanced routing, load balancing, and flow management capabilities.
## What You Get
* **One unified API** — a single, OpenAI-style `chat/completions` endpoint for every model.
* **Model routing** — switch between models by name; no provider-specific code.
* **Streaming** — token-by-token responses for real-time interfaces.
* **Usage tracking & credits** — every request is metered against one balance you can monitor.
* **Python SDK + REST** — an async-first `mira-network` client, or plain HTTP for any language.
## How It Compares
| | Mira Network | Per-provider integration |
| ---------------- | ------------------------ | -------------------------- |
| Models | One API for many | A separate API for each |
| Switching models | Change one string | Re-integrate each provider |
| Billing | One credit balance | Separate invoices |
| Response format | Consistent across models | Differs per provider |
| Streaming | Built in | Per-provider handling |
## What You'll Need
1. **Python 3.8+** to use the SDK — or any HTTP client to call the REST API directly.
2. **A Mira API key** — sign up at [console.mira.network](https://console.mira.network) and create a key (keys start with `sk-mira-`).
3. **Credits** on your account to cover model usage.
## Next Steps
Install and configure the Mira Network Python SDK.
Make your first API call in a few minutes.
# Quickstart
Source: https://docs.mira.network/network/get-started/quickstart
Make your first Mira Network call in minutes: chat completions, streaming responses, multi-turn conversations, and error handling with the Python SDK.
This guide walks you through your first calls with the Mira Network Python SDK.
**Before you start:** [install the SDK](/network/get-started/installation) and have your API key ready (it starts with `sk-mira-`). The examples read it from the `MIRA_API_KEY` environment variable — replace `"your-api-key"` with your own key or set that variable.
## Basic Chat Completion
Send a message and read the model's reply:
```python theme={null}
from mira_network import MiraClient
async def main():
async with MiraClient(api_key="your-api-key") as client:
response = await client.chat_completions_create(
model="gpt-4o-mini", # See list_models() for all available models
messages=[
{"role": "user", "content": "What is the capital of France?"}
]
)
print(response["choices"][0]["message"]["content"])
if __name__ == "__main__":
import asyncio
asyncio.run(main())
```
## Streaming Responses
For real-time responses:
```python theme={null}
async def stream_response():
async with MiraClient(api_key="your-api-key") as client:
stream = await client.chat_completions_create(
model="your-chosen-model",
messages=[{"role": "user", "content": "Write a story"}],
stream=True
)
async for chunk in stream:
print(chunk["choices"][0]["delta"]["content"], end="")
```
## Managing Conversations
Handle multi-turn conversations:
```python theme={null}
messages = [
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "Hi! Can you help me?"},
]
async with MiraClient(api_key="your-api-key") as client:
response = await client.chat_completions_create(
model="your-chosen-model",
messages=messages
)
```
## Error Handling
Handle validation and request errors:
```python theme={null}
try:
response = await client.chat_completions_create(
model="your-chosen-model",
messages=[{"role": "user", "content": "Hello"}]
)
except ValueError as e:
print(f"Validation error: {e}")
except Exception as e:
print(f"An error occurred: {e}")
```
## Next Steps
* Learn to [Generate Text](/network/model-operations/generate) with more options
* Browse the available [Models](/network/model-operations/list-models)
* Manage your [API Tokens](/network/token-operations/create-api-token)
* Check your [Credit Balance](/network/credit-operations/getting-credit)
# Generate Text
Source: https://docs.mira.network/network/model-operations/generate
Generate text using AI models via chat completions
## Text Generation
Use `chat_completions_create()` to generate text responses from AI models.
### Basic Usage
```python theme={null}
from mira_network import MiraClient
async def generate_text():
async with MiraClient(api_key="your-api-key") as client:
response = await client.chat_completions_create(
model="your-chosen-model",
messages=[
{"role": "user", "content": "What is the capital of France?"}
]
)
print(response["choices"][0]["message"]["content"])
```
### Streaming Responses
For real-time text generation:
```python theme={null}
async def stream_response():
async with MiraClient(api_key="your-api-key") as client:
stream = await client.chat_completions_create(
model="your-chosen-model",
messages=[{"role": "user", "content": "Write a story"}],
stream=True
)
async for chunk in stream:
print(chunk["choices"][0]["delta"]["content"], end="")
```
### Multi-turn Conversations
Handle complex dialogues:
```python theme={null}
messages = [
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "Hi! Can you help me?"},
{"role": "assistant", "content": "Of course! What can I help you with?"},
{"role": "user", "content": "Tell me about Paris"}
]
async with MiraClient(api_key="your-api-key") as client:
response = await client.chat_completions_create(
model="your-chosen-model",
messages=messages
)
```
### Error Handling
Handle validation and request errors:
```python theme={null}
try:
response = await client.chat_completions_create(
model="your-chosen-model",
messages=[{"role": "user", "content": "Hello"}]
)
except ValueError as e:
print(f"Validation error: {e}")
except Exception as e:
print(f"An error occurred: {e}")
```
### Custom Model Provider
Route a request to your own model endpoint by passing a `model_provider`:
```python theme={null}
response = await client.chat_completions_create(
model="your-chosen-model",
messages=[{"role": "user", "content": "Hello"}],
model_provider={
"base_url": "https://your-provider.com/v1",
"api_key": "your-provider-api-key"
}
)
```
## Message Structure
Core components of a message:
```python theme={null}
Message:
role: str # "system", "user", or "assistant"
content: str # The message content
```
# List Models
Source: https://docs.mira.network/network/model-operations/list-models
List the AI models available on Mira Network with list_models() and learn how to pick a model ID for chat completions.
## List Available Models
Use `list_models()` to see the models available on Mira Network and get the IDs you pass to chat completions.
### Example
```python theme={null}
from mira_network import MiraClient
async def explore_models():
async with MiraClient(api_key="your-api-key") as client:
result = await client.list_models()
# Each entry's "id" is the model name you pass to chat_completions_create()
for model in result["data"]:
print(model["id"])
```
### Response Structure
`list_models()` returns an OpenAI-style object with a `data` array:
```python theme={null}
{
"object": "list",
"data": [
{"id": "claude-haiku-4.5", "object": "model"},
{"id": "gpt-5.2", "object": "model"},
{"id": "gpt-4o-mini", "object": "model"},
{"id": "gemini-3-flash", "object": "model"},
{"id": "deepseek-v3.2", "object": "model"}
# ... model availability may change over time
]
}
```
### Usage Notes
* Pass a model's `id` as the `model` argument in [chat completions](/network/model-operations/generate).
* Different models have different capabilities and per-token pricing.
* The available models can change over time, so fetch this list rather than hardcoding it.
# Creating an API Token
Source: https://docs.mira.network/network/token-operations/create-api-token
Create Mira Network API tokens with create_api_token() and an ApiTokenRequest. Tokens start with sk-mira- and authenticate your requests.
## Create API Token
Generate new API tokens for authentication using the `create_api_token()` method.
### Example
`create_api_token()` takes an `ApiTokenRequest` (not a plain dict):
```python theme={null}
from mira_network import MiraClient, ApiTokenRequest
async def create_token():
async with MiraClient(api_key="your-api-key") as client:
new_token = await client.create_api_token(
ApiTokenRequest(description="Production API Key")
)
print(f"New token created: {new_token}")
```
### Response Structure
```python theme={null}
{
"id": "7b89fb91-ce54-49d5-b177-68f29cf670fa", # token id
"token": "sk-mira-xxxx...", # the API key (starts with sk-mira-)
"description": "Production API Key",
"meta_data": {},
"created_at": "2026-01-01T00:00:00.000Z"
}
```
The full `token` value is only returned here, at creation time. Copy and store it securely — you can't retrieve it again later.
### Usage Notes
* The full token is shown only at creation — store it securely.
* Use a clear `description` so you can identify the token later.
* Manage tokens in the [Mira Console](https://console.mira.network/api-keys).
# Delete API Token
Source: https://docs.mira.network/network/token-operations/deleting-api-token
Revoke and delete API tokens
## Delete API Token
Revoke access by deleting API tokens using the `delete_api_token()` method. Pass the **token value** (the `sk-mira-...` string), not the token's `id`.
### Example
```python theme={null}
from mira_network import MiraClient
async def delete_token():
async with MiraClient(api_key="your-api-key") as client:
# Pass the full token string (from create_api_token / list_api_tokens)
await client.delete_api_token("sk-mira-xxxx...")
print("Token successfully deleted")
```
### Error Handling
```python theme={null}
try:
await client.delete_api_token("sk-mira-xxxx...")
except Exception as e:
print(f"Error deleting token: {e}")
```
### Usage Notes
* Pass the `token` value (`sk-mira-...`), not the `id` — deleting by `id` returns `404`
* Deletion is permanent and cannot be undone
* Plan for service disruption if deleting active tokens
# List API Tokens
Source: https://docs.mira.network/network/token-operations/listing-api-tokens
Retrieve all active API tokens
## List API Tokens
View all active API tokens using the `list_api_tokens()` method.
### Example
```python theme={null}
from mira_network import MiraClient
async def list_tokens():
async with MiraClient(api_key="your-api-key") as client:
result = await client.list_api_tokens()
# Tokens are under "items"
for token in result["items"]:
print(f"{token['description']}: {token['token']}")
```
### Response Structure
`list_api_tokens()` returns a paginated object; the tokens are in `items`:
```python theme={null}
{
"items": [
{
"id": "43dbd302-0a07-428d-b7c3-fd2f7aa170bb",
"token": "sk-mira-xxxx...",
"description": "Production API Key",
"meta_data": {},
"created_at": "2026-01-01T00:00:00.000Z"
}
# ... other tokens
],
"total": 1,
"page": 1,
"page_size": 10,
"total_pages": 1
}
```
The response only includes token metadata — the full `token` value is returned once, at [creation](/network/token-operations/create-api-token).
### Usage Notes
* Audit active tokens periodically and delete any you no longer use.
* The `id` identifies a token; the `token` field is the key itself (`sk-mira-...`).
* View per-token usage and analytics in the [Mira Console](https://console.mira.network/api-keys).