Skip to main content

Overview

The Models API provides access to OpenFang’s comprehensive model catalog with 100+ models from 30+ providers, including cost tracking and authentication management.

List Models

Get all available models from the catalog:
GET /api/models

Get Model

Retrieve detailed information about a specific model:
GET /api/models/{id}

Model Tiers

Models are categorized by capability and cost:

List Providers

Get all model providers with authentication status:
GET /api/providers

Provider Authentication

Set API Key

Configure a provider’s API key:
POST /api/providers/{name}/key
API keys are stored in environment variables and never written to config files.

Delete API Key

Remove a provider’s API key:
DELETE /api/providers/{name}/key

Test Provider

Verify provider authentication by making a test API call:
POST /api/providers/{name}/test

Set Provider URL

Customize base URL for a provider (e.g., for proxies or custom deployments):
PUT /api/providers/{name}/url

Authentication Status

Providers report one of three authentication states:
status
API key is present and valid
status
API key is required but not configured
status
No API key needed (local providers)

Model Aliases

Many models have convenient aliases:

List Aliases

Get all registered aliases:
GET /api/models/aliases

Custom Models

Add user-defined models to the catalog:

Add Custom Model

POST /api/models/custom

Remove Custom Model

DELETE /api/models/custom/{id}

Cost Tracking

Models include pricing information for usage tracking:
number
Cost per million input tokens (USD)
number
Cost per million output tokens (USD)
Example calculation:

Usage Tracking

Track usage across agents and models:

Get Usage Stats

GET /api/usage

Usage by Model

GET /api/usage/by-model

Supported Providers

  • Anthropic - Claude models
  • OpenAI - GPT models
  • Google - Gemini models
  • DeepSeek - DeepSeek models
  • Groq - Ultra-fast inference
  • OpenRouter - Multi-provider router
  • Mistral - Mistral models
  • Together - Open-source models
  • Fireworks - Fast inference
  • Perplexity - Search-augmented models
  • Cohere - Command models
  • AI21 - Jamba models
  • Cerebras - Fast inference
  • SambaNova - Fast inference
  • Hugging Face - Inference API
  • xAI - Grok models
  • Replicate - Model marketplace
  • GitHub Copilot - Claude via GitHub
  • AWS Bedrock - Multi-provider on AWS
  • Qwen - Alibaba Cloud
  • MiniMax - Abab models
  • Zhipu - GLM models
  • Moonshot - Moonshot models
  • Qianfan - Baidu
  • Volcengine - ByteDance
  • Ollama - Local model runner
  • vLLM - High-performance local inference
  • LM Studio - Desktop model runner

Provider Base URLs

Default base URLs for each provider:

Model Capabilities

Tool Calling

Model can execute function calls and use tools

Vision

Model can process image inputs

Streaming

Model supports streaming responses

Budget Management

Set spending limits and track costs:

Get Budget Status

GET /api/budget

Update Budget

PUT /api/budget

Per-Agent Budget

Track spending by individual agent:
GET /api/budget/agents

Next Steps

Agents API

Spawn agents with specific models

Authentication

Secure your API