Skip to content

Quick Start Guide

Welcome to the Quick Start Guide for Mira. This guide will help you begin using our platform to leverage powerful API services effortlessly. Whether you are looking to integrate directly via API or through our SDKs, this guide will provide you with the essential steps to make your first API call.

Step 1: Setup Your Environment

Before you can start using the Mira flows, you'll need to set up your environment:

For API Usage

  1. Ensure you have curl or any HTTP client installed: This will be used to make direct API calls to test and use the flows.

For SDK Usage

  1. Install Node.js or Python:

  2. Install the Mira SDK:

    • For Node.js, use npm or yarn:
      bash
      npm install @mira-network/sdk
      or
      bash
      yarn add @mira-network/sdk
    • For Python, use pip:
      bash
      pip install mira-sdk

Step 2: Obtain API Keys

To securely access Mira flows, you'll need to obtain API keys:

  1. Register on the Mira platform: Visit our registration page.
  2. Generate API keys: Follow the instructions in your account dashboard to generate new API keys.

Step 3: Make Your First API Call

Now that you have your environment set up and API keys ready, let's make your first API call:

Using the API Directly

Here's how to call the @klok/qna flow 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 '{"query": "What is the API service?"}'

Using the Node.js SDK

javascript
import { Client } from "@mira-network/sdk";

const client = new Client({
  apiKey: "YOUR_API_KEY",
});

async function fetchAnswer() {
  const input = {
    query: "What is the API service?",
  };

  const output = await client.run("@klok/qna", input);
  console.log(output);
}

fetchAnswer();

Using the Python SDK

python
from mira_sdk import Client

client = Client(api_key='YOUR_API_KEY')

def fetch_answer():
    input = {
        "query": "What is the API service?"
    }

    output = client.run('@klok/qna', input)
    print(output)

fetch_answer()

Next Steps

Congratulations on making your first API call! Explore more about using Mira by checking our detailed documentation on APIs and SDK usage in the respective sections.

This quick start guide aims to get you from setup to your first API call as quickly as possible, but it is just the beginning. Explore further to see what you can build with Mira!