Contributing to Portkey Models

March 6, 2026 · View on GitHub

Thank you for your interest in contributing to the Portkey Models repository! This community-maintained database helps developers track AI model pricing and configurations across 35+ providers.

Table of Contents

Getting Started

  1. Fork this repository
  2. Clone your fork locally
  3. Make your changes
  4. Test your changes (validate JSON)
  5. Submit a pull request

Types of Contributions

ContributionDirectoryDescription
Model Pricingpricing/Token costs, image pricing, additional units
Model Configsgeneral/Parameters, capabilities, supported features

Adding or Updating Pricing

Pricing files are located in pricing/{provider}.json.

Price Format

⚠️ Prices are in cents per token, not dollars.

Provider PricingJSON ValueCalculation
$0.03 / 1K tokens0.003$0.03 ÷ 1000 = 0.00003 dollars = 0.003 cents
$2.50 / 1M tokens0.00025$2.50 ÷ 1,000,000 = 0.0000025 dollars = 0.00025 cents
$10 / 1M tokens0.001$10 ÷ 1,000,000 = 0.00001 dollars = 0.001 cents

Quick formula: price_in_cents = (dollars_per_million / 1,000,000) * 100

Schema Structure

{
  "model-name": {
    "pricing_config": {
      "pay_as_you_go": {
        "request_token": { "price": 0.001 },
        "response_token": { "price": 0.002 },
        "cache_write_input_token": { "price": 0 },
        "cache_read_input_token": { "price": 0.0005 }
      },
      "currency": "USD"
    }
  }
}

Available Fields

FieldDescription
request_tokenInput token cost
response_tokenOutput token cost
cache_write_input_tokenCache write cost
cache_read_input_tokenCache read cost
request_audio_tokenAudio input cost
response_audio_tokenAudio output cost
additional_unitsProvider-specific (web_search, thinking_token, etc.)
imageImage generation pricing by quality/size

Adding a New Provider

  1. Create pricing/{provider-name}.json
  2. Use lowercase with hyphens (e.g., together-ai.json)
  3. Include a default entry with zero prices
  4. Add model-specific pricing
{
  "default": {
    "pricing_config": {
      "pay_as_you_go": {
        "request_token": { "price": 0 },
        "response_token": { "price": 0 }
      },
      "currency": "USD"
    }
  },
  "model-name": {
    "pricing_config": {
      "pay_as_you_go": {
        "request_token": { "price": 0.001 },
        "response_token": { "price": 0.002 }
      }
    }
  }
}

Adding Model Configurations

Configuration files are located in general/{provider}.json.

Schema Structure

{
  "model-name": {
    "params": [
      {
        "key": "max_tokens",
        "maxValue": 16384
      },
      {
        "key": "temperature",
        "defaultValue": 1,
        "minValue": 0,
        "maxValue": 2
      }
    ],
    "type": {
      "primary": "chat",
      "supported": ["tools", "image"]
    }
  }
}

Type Values

Primary TypeDescription
chatChat completion models
textText completion models
embeddingEmbedding models
imageImage generation models
audioAudio models
Supported FeaturesDescription
toolsFunction calling support
imageVision/image input support
cache_controlPrompt caching support

Submitting Your Changes

Before Submitting

  1. Validate JSON syntax

    # Validate all pricing files
    for file in pricing/*.json; do jq empty "$file" && echo "✅ $file"; done
    
    # Validate all general files
    for file in general/*.json; do jq empty "$file" && echo "✅ $file"; done
    
  2. Check your pricing math — Remember: cents per token, not dollars!

  3. Find the source — You'll need to provide a link to official pricing

Pull Request Guidelines

  1. Title format: [provider] Brief description

    • Example: [openai] Add GPT-5 pricing
    • Example: [anthropic] Update Claude 4 cache pricing
  2. Include source link — Link to the provider's official pricing page

  3. One provider per PR — Makes review easier

  4. Sign the CLA — First-time contributors must sign our Contributor License Agreement

What Happens Next

  1. Automated checks validate your JSON
  2. A maintainer reviews your PR
  3. Once merged, changes sync to Portkey's systems

Code of Conduct

Please read our Code of Conduct before contributing. We're committed to providing a welcoming and inclusive environment.

Questions?

  • 💬 Discord — Ask in #open-source
  • 🐛 Issues — Report bugs or request features
  • 📖 Documentation — Learn more about Portkey

Thank you for helping keep AI model pricing accurate and up-to-date! 🙏