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:
- API endpoints - The URLs and HTTP methods your API supports
- Authentication - How users authenticate with your API
- Request/response schemas - The structure of data sent and received
- 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.
Navigate to resources
- Open the Developer Dashboard
- Click "Resources" in the sidebar navigation
- Click the "Create Resource" button
- 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:
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:
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.
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:
- Click the "Test" tab in the resource editor
- Select an endpoint to test
- Provide required parameters:
- Add authentication credentials (if required)
- Click "Send Request" to execute the test
- Review the response:
- Test all endpoints with various parameters
- Verify error handling with invalid inputs
- 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:
- Review all configuration and documentation
- Ensure all endpoints are tested and working
- Verify pricing is set correctly
- Click "Publish" to make your resource live
- 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:
Comprehensive parameter documentation
Document all parameters with descriptions, types, and examples:
Detailed response schemas
Define complete response schemas with property descriptions:
Error handling
Document all possible error responses:
Reusable components
Use components to avoid repetition:
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:
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
openapiversion is 3.0.x (not 2.0) - Ensure all required fields are present (info, paths, servers)
- Verify schema references are correct (
$refpaths) - 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
pathsin 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:
- Creating Scripts - Build automation scripts that use your resources
- Managing Your Profile - Optimize your developer profile
- Handling Reviews - Engage with users and respond to feedback
- Best Practices - Tips for building successful integrations
See also
- Core Concepts: Resources - Understanding resources in depth
- Examples: Resources - Working resource examples with complete code
- Getting Started: Authentication - Authentication patterns and best practices
- OpenAPI 3.0 Specification - Official OpenAPI documentation
- Swagger Editor - Online OpenAPI editor and validator