Quickstart

Get started with Mira Console in 5 minutes

This guide will walk you through making your first API request to verify a fact.

Prerequisites

  • A Mira Console account (sign up here)
  • cURL or any HTTP client

Step 1: Create an App

  1. Log in to the Dashboard
  2. Click Create App
  3. Enter a name for your app (e.g., "My First App")
  4. Click Create

Step 2: Generate an API Key

  1. Click on your newly created app
  2. Click Create Key
  3. Select Verify Service
  4. Click Create
  5. Important: Copy the API key immediately - you won't be able to see it again!

Your key will look like: mk_verify_abc123def456...

Step 3: Add Funds

Before making API calls, you need funds in your account:

  1. On the app details page, click Add Funds
  2. Select the amount you want to add
  3. Complete the payment via Stripe

Step 4: Make Your First Request

Use cURL to verify a fact:

curl -X POST https://console.mira.network/verify/v1/stream \
  -H "Authorization: Bearer mk_verify_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fact": "The Earth orbits the Sun"
  }'

Understanding the Response

The API returns Server-Sent Events (SSE) with real-time progress:

event: starting
data: {"status":"starting"}

event: extracting_claims
data: {"status":"extracting_claims"}

event: claims_extracted
data: {"claims":["The Earth orbits the Sun"],"count":1}

event: verifying_claim
data: {"claimIndex":0,"claim":"The Earth orbits the Sun"}

event: claim_verified
data: {"claimIndex":0,"assessment":"TRUE","consensus":"A"}

event: completed
data: {
  "requestId": "req_abc123",
  "original_fact": "The Earth orbits the Sun",
  "results": [{
    "assessment": "TRUE",
    "claim": "The Earth orbits the Sun",
    "consensus_answer": "A"
  }],
  "tokenUsage": {
    "totalTokens": 1234
  }
}

Using JavaScript

Here's how to consume the SSE stream in JavaScript:

const response = await fetch('https://console.mira.network/verify/v1/stream', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer mk_verify_YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fact: 'The Earth orbits the Sun',
  }),
});

const reader = response.body.getReader();
const decoder = new TextDecoder();

while (true) {
  const { done, value } = await reader.read();
  if (done) break;

  const text = decoder.decode(value);
  console.log(text);
}

Next Steps