Martian Documentation
Martian provides unified access to 200+ AI models through a single API, enabling you to select the most effective model for your use case while maintaining compatibility with popular frameworks.
Key Benefits
- Access to 200+ models from leading providers
- Compatibility with OpenAI and Anthropic APIs
- Intelligent model routing with cost optimization
For example, simply populate the model
field when making requests:
curl https://api.withmartian.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MARTIAN_API_KEY" \
-d '{
"model": "openai/gpt-4.1-nano",
"messages": [
{
"role": "user",
"content": "What is Olympus Mons?"
}
]
}'
Monitoring & Analytics
Track your usage and optimize costs through the Martian Dashboard:
- Real-time Usage: Monitor API calls, tokens, and costs
- Model Performance: Compare accuracy and latency across models
- Cost Analysis: Identify savings opportunities with smart routing
- Request History: Debug and analyze API interactions
Getting started
Get your API key from the Martian Dashboard and start making requests immediately. Our API is fully compatible with existing OpenAI and Anthropic SDKs, requiring minimal code changes.
Resources
Code Examples
Practical examples and code snippets for common use cases, from basic chat to advanced tool use.
Support
Get help with integration, troubleshooting, and best practices. Access dashboard and community support.
Getting Help
Martian provides the following resources to help you use the API:
- Support: Contact our team through the Martian Dashboard
- Community: Join our Discord for discussions and updates
Ready to get started? Grab your API key and make your first request in under three minutes!