Mirra
Build

Creating Resources

A resource is an API integration that connects external services to Mirra agents. This guide covers everything you need to create, configure, test, and publish resources on the Mirra Store.

By the end of this guide, you will understand how to define API endpoints using OpenAPI 3.0, configure authentication methods, set pricing models, and publish your resource to the marketplace.

What is a resource?

A resource is an API service or integration that users can install and use through their Mirra agents. Resources expose external APIs to the Mirra platform using the OpenAPI 3.0 specification format.

How resources work

When you create a resource, you define:

  1. API endpoints - The URLs and HTTP methods your API supports
  2. Authentication - How users authenticate with your API
  3. Request/response schemas - The structure of data sent and received
  4. Pricing - How you monetize access to your API

Users install your resource into their agents, provide authentication credentials (if required), and then their agents can call your API endpoints through natural language interactions.

Use cases for resources

Resources are ideal for:

  • External APIs - Weather data, maps, geocoding, currency conversion
  • Database connectors - PostgreSQL, MongoDB, Redis, Elasticsearch
  • Payment gateways - Stripe, PayPal, Square payment processing
  • AI services - OpenAI, Anthropic, Hugging Face model access
  • Communication services - Twilio SMS, SendGrid email, Slack messaging
  • Custom APIs - Your own services and microservices

Prerequisites

Before creating a resource, ensure you have:

  • API to integrate - A working API with accessible endpoints
  • OpenAPI 3.0 specification - API documentation in OpenAPI format (or ability to create it)
  • Authentication details - Information about how users authenticate with your API
  • Test credentials - API keys or tokens for testing your integration

If you don't have an OpenAPI specification, you can create one using tools like Swagger Editor or by following the OpenAPI 3.0 specification.

Creating a resource

Follow these steps to create and publish a resource on the Mirra Store.

  1. Open the Developer Dashboard
  2. Click "Resources" in the sidebar navigation
  3. Click the "Create Resource" button
  4. Alternatively, use the keyboard shortcut Ctrl+N

The resource editor opens with fields for your API configuration.

Fill in basic information

Provide essential metadata about your resource:

{
  "name": "Weather API",
  "description": "Real-time weather data and forecasts for any location worldwide",
  "category": "Data & APIs",
  "tags": ["weather", "forecast", "climate", "meteorology", "temperature"]
}

Field requirements:

  • Name - Unique, descriptive name (3-50 characters)
  • Description - Clear explanation of what your API provides (10-500 characters)
  • Category - Select from predefined categories (Data & APIs, AI & ML, Communication, etc.)
  • Tags - Keywords for discoverability (3-10 tags recommended)

Choose a name and description that clearly communicate the value of your API to potential users.

Add OpenAPI specification

Provide your API specification in OpenAPI 3.0 format. The platform validates your specification and generates documentation automatically.

Minimum required components:

openapi: 3.0.0
info:
  title: Weather API
  version: 1.0.0
  description: Real-time weather data and forecasts
servers:
  - url: https://api.weather.example.com/v1
paths:
  /current:
    get:
      summary: Get current weather
      parameters:
        - name: location
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Current weather data
          content:
            application/json:
              schema:
                type: object
                properties:
                  temperature:
                    type: number
                  conditions:
                    type: string

Required sections:

  • openapi - Version number (must be 3.0.x)
  • info - API metadata (title, version, description)
  • servers - Base URLs for your API endpoints
  • paths - Endpoint definitions with operations, parameters, and responses
  • components (optional but recommended) - Reusable schemas and security definitions

See the Resources examples for complete working specifications.

Configure authentication

Choose the authentication method that matches your API. The platform handles credential storage and injection automatically.

No authentication required

Select this option if your API is publicly accessible without authentication.

security: []

Use cases: Public data APIs, rate-limited free APIs, internal services

The platform securely stores user credentials and injects them into API requests automatically.

Set pricing

Choose your pricing model based on your business strategy:

Free access

Offer your resource at no cost to users.

Benefits:

  • Build user base quickly
  • Gain marketplace visibility
  • Establish reputation
  • No payment processing overhead

Best for: New developers, open-source projects, freemium models

You can change your pricing model after publishing, but price increases may affect existing users.

Test your resource

Use the built-in testing tools to verify your resource works correctly:

  1. Click the "Test" tab in the resource editor
  2. Select an endpoint to test
  3. Provide required parameters:
{
  "location": "San Francisco, CA"
}
  1. Add authentication credentials (if required)
  2. Click "Send Request" to execute the test
  3. Review the response:
{
  "temperature": 68,
  "conditions": "Partly Cloudy",
  "humidity": 65,
  "windSpeed": 12
}
  1. Test all endpoints with various parameters
  2. Verify error handling with invalid inputs
  3. Check authentication with different credentials

Test thoroughly before publishing. Verify all endpoints work correctly, authentication is properly configured, and error messages are helpful.

Publish your resource

When your resource is ready, publish it to make it available to users:

  1. Review all configuration and documentation
  2. Ensure all endpoints are tested and working
  3. Verify pricing is set correctly
  4. Click "Publish" to make your resource live
  5. Your resource appears in the marketplace immediately

Post-publishing checklist:

  • ✅ Resource appears in marketplace search
  • ✅ Users can view documentation and examples
  • ✅ Users can install the resource into their agents
  • ✅ Authentication flow works for new users
  • ✅ API calls are tracked and billed correctly

Your resource is now live in the marketplace! Users can discover, install, and use it through their agents.

OpenAPI specification best practices

Follow these best practices when creating your OpenAPI specification:

Clear endpoint descriptions

Provide clear, concise descriptions for all endpoints:

paths:
  /current:
    get:
      summary: Get current weather conditions
      description: Returns real-time weather data including temperature, conditions, humidity, and wind speed for the specified location.

Comprehensive parameter documentation

Document all parameters with descriptions, types, and examples:

parameters:
  - name: location
    in: query
    required: true
    description: City name, zip code, or coordinates (lat,lon)
    schema:
      type: string
    example: "San Francisco, CA"

Detailed response schemas

Define complete response schemas with property descriptions:

responses:
  '200':
    description: Successful response
    content:
      application/json:
        schema:
          type: object
          properties:
            temperature:
              type: number
              description: Temperature in Fahrenheit
            conditions:
              type: string
              description: Current weather conditions

Error handling

Document all possible error responses:

responses:
  '400':
    description: Invalid location parameter
  '401':
    description: Invalid or missing API key
  '429':
    description: Rate limit exceeded
  '500':
    description: Internal server error

Reusable components

Use components to avoid repetition:

components:
  schemas:
    WeatherData:
      type: object
      properties:
        temperature:
          type: number
        conditions:
          type: string
  responses:
    UnauthorizedError:
      description: Invalid or missing authentication

Authentication best practices

Follow these best practices when configuring authentication:

API key security

  • Never expose your own API keys - Users provide their own keys
  • Document key requirements - Explain how users get API keys
  • Support key rotation - Allow users to update their keys
  • Validate keys properly - Return clear error messages for invalid keys

OAuth2 configuration

  • Request minimal scopes - Only request permissions you need
  • Handle token refresh - Implement automatic token refresh
  • Provide clear instructions - Explain the authorization process
  • Test authorization flow - Verify the complete OAuth flow works

Credential storage

  • Platform handles storage - Credentials are encrypted and stored securely
  • Users control access - Users can revoke access at any time
  • No credential exposure - Your code never sees raw credentials
  • Automatic injection - Platform injects credentials into requests

Pricing strategies

Choose the right pricing strategy for your resource:

Free tier strategy

Start with a free tier to build your user base:

{
  "pricingModel": "free",
  "rateLimits": {
    "requestsPerDay": 1000,
    "requestsPerMinute": 10
  }
}

Benefits: User acquisition, feedback collection, market validation

Freemium model

Offer basic features free with paid upgrades:

  • Free tier - Limited requests, basic features
  • Pro tier - Higher limits, advanced features
  • Enterprise tier - Unlimited requests, premium support

Usage-based pricing

Charge based on actual usage:

  • Low volume - $0.001 per request (1000 requests = $1)
  • Medium volume - $0.01 per request (100 requests = $1)
  • High value - $0.10 per request (10 requests = $1)

Subscription pricing

Offer unlimited access for a fixed fee:

  • Basic - $9.99/month - Standard features
  • Pro - $29.99/month - Advanced features
  • Enterprise - $99.99/month - All features + support

Troubleshooting

Common issues when creating resources and their solutions.

OpenAPI validation errors

Problem: Your OpenAPI specification fails validation.

Solutions:

  • Use Swagger Editor to validate your spec
  • Check that openapi version is 3.0.x (not 2.0)
  • Ensure all required fields are present (info, paths, servers)
  • Verify schema references are correct ($ref paths)
  • Check for syntax errors in YAML or JSON

Authentication not working

Problem: API requests fail with authentication errors.

Solutions:

  • Verify security scheme is correctly defined in components.securitySchemes
  • Check that security requirement is applied to endpoints
  • Test with valid credentials in the testing panel
  • Ensure API key location (header/query/cookie) matches your API
  • For OAuth2, verify authorization and token URLs are correct

Endpoints not appearing

Problem: Some endpoints don't appear in the generated documentation.

Solutions:

  • Check that endpoints are defined under paths in your spec
  • Ensure each endpoint has at least one HTTP method (get, post, etc.)
  • Verify YAML/JSON syntax is correct (indentation, commas)
  • Check for duplicate path definitions
  • Ensure all required fields are present for each operation

Rate limiting issues

Problem: Users hit rate limits too quickly.

Solutions:

  • Implement rate limiting in your API
  • Document rate limits in your resource description
  • Consider higher limits for paid tiers
  • Provide clear error messages when limits are exceeded
  • Allow users to monitor their usage

Next steps

Now that you understand how to create resources, explore these related topics:

See also

On this page