### Install Dependencies and Run Frontend Dev Server Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Commands to install project dependencies using Bun and start the frontend development server. The frontend will be accessible at http://localhost:3000. ```bash bun install cd packages/web bun run dev ``` -------------------------------- ### Install Dependencies with Bun Source: https://context7.com/anomalyco/models.dev/llms.txt Installs project dependencies using Bun. Ensure Bun is installed before running this command. ```bash # Install dependencies (requires Bun) bun install ``` -------------------------------- ### Run Development Server Source: https://github.com/anomalyco/models.dev/blob/dev/AGENTS.md Start the development server for the web interface by navigating to its directory and running the dev command. ```bash cd packages/web && bun run dev ``` -------------------------------- ### Run Development Server Source: https://context7.com/anomalyco/models.dev/llms.txt Starts the development server for the web package. The server typically runs on http://localhost:3000. ```bash # Run development server cd packages/web bun run dev # Opens at http://localhost:3000 ``` -------------------------------- ### Cost Schema Example Source: https://github.com/anomalyco/models.dev/blob/dev/AGENTS.md Illustrates the structure for defining cost information, including specific pricing for contexts over 200K tokens. ```toml [cost] context_over_200k = { context = 200000, tokens = 100000, price = 0.00001 } ``` -------------------------------- ### Run opencode for Manual Testing Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Install dependencies, build the web package, and run opencode to test provider changes. Ensure OPENCODE_MODELS_PATH is set correctly. ```bash $ bun install $ cd packages/web $ bun run build $ OPENCODE_MODELS_PATH="dist/_api.json" opencode ``` -------------------------------- ### Bedrock Model Naming Convention (Latest) Source: https://github.com/anomalyco/models.dev/blob/dev/AGENTS.md Example of a latest/undated model naming pattern used in Bedrock, with a bare version suffix. ```toml anthropic.claude-opus-4-6-v1.toml ``` -------------------------------- ### Bedrock Model Naming Convention (Regional) Source: https://github.com/anomalyco/models.dev/blob/dev/AGENTS.md Example of a regional prefix used in Bedrock model naming. ```toml us.anthropic.claude-3-5-sonnet-20241022-v1:0.toml ``` -------------------------------- ### Generate Model Files with Bun Source: https://github.com/anomalyco/models.dev/blob/dev/providers/helicone/README.md Use this command to generate model TOML files from Helicone's public registry. Ensure Bun is installed. ```bash bun run helicone:generate ``` -------------------------------- ### Vertex AI Model Naming Convention (Latest) Source: https://github.com/anomalyco/models.dev/blob/dev/AGENTS.md Example of a latest/undated model naming pattern used in Vertex AI, using '@default'. ```toml claude-opus-4-6@default.toml ``` -------------------------------- ### Bedrock Model Naming Convention (Dated) Source: https://github.com/anomalyco/models.dev/blob/dev/AGENTS.md Example of a dated model naming pattern used in Bedrock, including a version suffix. ```toml anthropic.claude-3-5-sonnet-20241022-v1:0.toml ``` -------------------------------- ### TOML Model Definition Example Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Define a new AI model by creating a TOML file with its ID as the filename. This includes details like display name, capabilities (attachments, reasoning, tool calls), cost, limits, and supported modalities. ```toml name = "Model Display Name" attachment = true # or false - supports file attachments reasoning = false # or true - supports reasoning / chain-of-thought tool_call = true # or false - supports tool calling structured_output = true # or false - supports a dedicated structured output feature temperature = true # or false - supports temperature control knowledge = "2024-04" # Knowledge-cutoff date release_date = "2025-02-19" # First public release date last_updated = "2025-02-19" # Most recent update date open_weights = true # or false - model’s trained weights are publicly available [cost] input = 3.00 # Cost per million input tokens (USD) output = 15.00 # Cost per million output tokens (USD) reasoning = 15.00 # Cost per million reasoning tokens (USD) cache_read = 0.30 # Cost per million cached read tokens (USD) cache_write = 3.75 # Cost per million cached write tokens (USD) input_audio = 1.00 # Cost per million audio input tokens (USD) output_audio = 10.00 # Cost per million audio output tokens (USD) [limit] context = 400_000 # Maximum context window (tokens) input = 272_000 # Maximum input tokens output = 8_192 # Maximum output tokens [modalities] input = ["text", "image"] # Supported input modalities output = ["text"] # Supported output modalities [interleaved] field = "reasoning_content" # Name of the interleaved field "reasoning_content" or "reasoning_details" ``` -------------------------------- ### SVG Logo Structure Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Example structure for an SVG logo file. Logos should be in SVG format, use `currentColor` for fills/strokes, and have no fixed size or colors. ```svg ``` -------------------------------- ### Generate/Update Model TOMLs with Bun Source: https://github.com/anomalyco/models.dev/blob/dev/providers/venice/README.md Use this command to generate or update model TOML files from Venice AI's API. Ensure Bun is installed. ```bash bun run venice:generate ``` -------------------------------- ### Vertex AI Model Naming Convention (Dated) Source: https://github.com/anomalyco/models.dev/blob/dev/AGENTS.md Example of a dated model naming pattern used in Vertex AI, with an '@' symbol and date. ```toml claude-opus-4-5@20251101.toml ``` -------------------------------- ### Build Web Interface Source: https://github.com/anomalyco/models.dev/blob/dev/AGENTS.md Navigate to the web package directory and execute the build command to compile the web interface. ```bash cd packages/web && bun run build ``` -------------------------------- ### Include All Providers in utils.sh Source: https://github.com/anomalyco/models.dev/blob/dev/providers/cloudflare-ai-gateway/README.md Customize the `scripts/utils.sh` file to include all desired providers by setting the `INCLUDE_ALL_PROVIDERS` variable. ```bash INCLUDE_ALL_PROVIDERS="workers-ai replicate my-new-provider" ``` -------------------------------- ### TOML Configuration for a New Provider Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Define a new AI model provider by creating a `provider.toml` file. Include essential details like the provider's name, AI SDK package, environment variables for authentication, and documentation links. ```toml name = "Provider Name" npm = "@ai-sdk/provider" # AI SDK Package name env = ["PROVIDER_API_KEY"] # Environment Variable keys used for auth doc = "https://example.com/docs/models" # Link to provider's documentation ``` -------------------------------- ### Build for Production Source: https://context7.com/anomalyco/models.dev/llms.txt Generates production-ready build artifacts in the dist/ directory, including API data and an HTML index file. ```bash # Build for production bun run build # Generates dist/ with _api.json and _index.html ``` -------------------------------- ### Run Cloudflare AI Gateway Provider Scripts Source: https://github.com/anomalyco/models.dev/blob/dev/providers/cloudflare-ai-gateway/README.md This bash script demonstrates how to execute the Cloudflare AI Gateway provider scripts in sequence. Ensure the required environment variables are set before running. ```bash # Step 1: Fetch model data from Cloudflare API cd scripts CLOUDFLARE_API_TOKEN=xxx \ CLOUDFLARE_ACCOUNT_ID=xxx \ CLOUDFLARE_GATEWAY_ID=xxx \ ./01_fetch_model_data.sh # Step 2: Update model name mappings ./02_generate_model_names.sh # Step 3: Generate TOML files ./03_generate_model_toml.sh ``` -------------------------------- ### Compare Model TOML Migrations Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Run this command to compare TOML files after converting wrapper models to use `extends`. It helps confirm that generated JSON changes are intentional. ```bash bun run compare:migrations ``` -------------------------------- ### Preview Model TOML Changes with Bun Source: https://github.com/anomalyco/models.dev/blob/dev/providers/venice/README.md Execute a dry run to preview changes to model TOML files without applying them. This is useful for verifying the generation process. ```bash bun run venice:generate --dry-run ``` -------------------------------- ### Gemini 2.5 Pro Wrapper Provider Configuration Source: https://context7.com/anomalyco/models.dev/llms.txt Configuration for a wrapper provider that extends the canonical Google Gemini 2.5 Pro model. It allows for pricing overrides and omission of specific features like structured output, reusing the base model definition. ```toml # providers/requesty/models/google/gemini-2.5-pro.toml # Extends the canonical Google model with different pricing [extends] from = "google/gemini-2.5-pro" omit = ["structured_output"] [cost] input = 1.25 output = 10.00 cache_read = 0.31 cache_write = 2.375 ``` -------------------------------- ### Compare Model Migrations Source: https://context7.com/anomalyco/models.dev/llms.txt Compares model migrations, likely used when converting existing model definitions to use the 'extends' feature for configuration. ```bash # Compare model migrations when converting to extends bun run compare:migrations ``` -------------------------------- ### Generate Model TOMLs with API Key Source: https://github.com/anomalyco/models.dev/blob/dev/providers/venice/README.md Include alpha models in the generation process by providing a Venice API key via the CLI argument. Replace YOUR_KEY with your actual API key. ```bash bun run venice:generate --api-key=YOUR_KEY ``` -------------------------------- ### Test Local Changes with opencode Source: https://context7.com/anomalyco/models.dev/llms.txt Tests local changes by configuring opencode to use locally built API data. Ensure the web package is built first. ```bash # Build the web package first cd packages/web bun run build # Run opencode with local models data OPENCODE_MODELS_PATH="dist/_api.json" opencode ``` -------------------------------- ### Gemini 2.5 Pro Model Configuration with Extended Context Pricing Source: https://context7.com/anomalyco/models.dev/llms.txt Configuration for Gemini 2.5 Pro, featuring extended context pricing tiers. It details standard and tiered costs for input, output, and cache reads based on context length, along with maximum context and output limits, and supported input/output modalities including audio and video. ```toml # providers/google/models/gemini-2.5-pro.toml name = "Gemini 2.5 Pro" family = "gemini-pro" release_date = "2025-03-20" last_updated = "2025-06-05" attachment = true reasoning = true temperature = true knowledge = "2025-01" tool_call = true structured_output = true open_weights = false [cost] input = 1.25 output = 10.00 cache_read = 0.125 [cost.context_over_200k] input = 2.50 output = 15.00 cache_read = 0.25 [limit] context = 1_048_576 output = 65_536 [modalities] input = ["text", "image", "audio", "video", "pdf"] output = ["text"] ``` -------------------------------- ### Fetch All Model Data Source: https://context7.com/anomalyco/models.dev/llms.txt Retrieves the complete AI model database. Use jq to filter and process the JSON response for specific information like model IDs or pricing. ```bash # Fetch the complete API data curl https://models.dev/api.json ``` ```bash # Filter and process with jq - get all OpenAI model IDs curl -s https://models.dev/api.json | jq '.openai.models | keys' ``` ```bash # Get pricing for a specific model curl -s https://models.dev/api.json | jq '.anthropic.models["claude-sonnet-4-5"].cost' ``` -------------------------------- ### Generate Vercel AI Gateway Model TOMLs Source: https://github.com/anomalyco/models.dev/blob/dev/providers/vercel/README.md Use this command to generate TOML files for Vercel AI Gateway models. The generator merges with existing files and warns about orphaned files but does not delete them. Use `--dry-run` to preview changes or `--new-only` to skip updating existing files. ```bash bun run vercel:generate ``` ```bash bun run vercel:generate --dry-run ``` ```bash bun run vercel:generate --new-only ``` -------------------------------- ### Validate Model Configurations Source: https://github.com/anomalyco/models.dev/blob/dev/providers/vercel/README.md Run this command to validate the generated model TOML files. ```bash bun validate ``` -------------------------------- ### Validate Provider and Model TOML Files Source: https://context7.com/anomalyco/models.dev/llms.txt Runs a validation script to check the integrity and correctness of all provider and model TOML configuration files in the project. ```bash # Validate all provider and model TOML files bun run validate ``` -------------------------------- ### Fetch All Model Data Source: https://context7.com/anomalyco/models.dev/llms.txt Retrieves the complete AI model database, encompassing all providers and their respective models with detailed specifications, pricing, and capabilities. ```APIDOC ## GET /api.json ### Description Returns the complete model database including all providers and their models with specifications, pricing, and capabilities. ### Method GET ### Endpoint /api.json ### Request Example ```bash curl https://models.dev/api.json ``` ### Response #### Success Response (200) - **body** (object) - A JSON object containing all AI model data organized by provider. #### Response Example ```json { "anthropic": { "id": "anthropic", "name": "Anthropic", "npm": "@ai-sdk/anthropic", "env": ["ANTHROPIC_API_KEY"], "doc": "https://docs.anthropic.com/en/docs/about-claude/models", "models": { "claude-sonnet-4-5": { "id": "claude-sonnet-4-5", "name": "Claude Sonnet 4.5 (latest)", "family": "claude-sonnet", "attachment": true, "reasoning": true, "tool_call": true, "temperature": true, "knowledge": "2025-07-31", "open_weights": false, "cost": { "input": 3.00, "output": 15.00, "cache_read": 0.30, "cache_write": 3.75 }, "limit": { "context": 200000, "output": 64000 }, "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }, "release_date": "2025-09-29", "last_updated": "2025-09-29" } } }, "openai": { ... } } ``` ``` -------------------------------- ### TOML Configuration for OpenAI-Compatible Endpoint Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Configure a provider that uses an OpenAI-compatible endpoint. Specify the AI SDK package as `@ai-sdk/openai-compatible` and provide the `api` base URL. ```toml npm = "@ai-sdk/openai-compatible" # Use OpenAI-compatible SDK api = "https://api.example.com/v1" # Required with openai-compatible ``` -------------------------------- ### GPT-4o Model Configuration Source: https://context7.com/anomalyco/models.dev/llms.txt Configuration for the GPT-4o model, specifying its family, release date, capabilities like attachment and tool calls, and cost details for input, output, and cached reads. It also defines context and output limits, and supported input/output modalities. ```toml # providers/openai/models/gpt-4o.toml name = "GPT-4o" family = "gpt" release_date = "2024-05-13" last_updated = "2024-08-06" attachment = true reasoning = false temperature = true knowledge = "2023-09" tool_call = true structured_output = true open_weights = false [cost] input = 2.50 # USD per million input tokens output = 10.00 # USD per million output tokens cache_read = 1.25 # USD per million cached read tokens [limit] context = 128_000 # Maximum context window tokens output = 16_384 # Maximum output tokens [modalities] input = ["text", "image", "pdf"] output = ["text"] ``` -------------------------------- ### Generate Vercel Models Source: https://context7.com/anomalyco/models.dev/llms.txt Automatically generates model definitions for the Vercel provider. ```bash # Generate Vercel models bun run vercel:generate ``` -------------------------------- ### Add Well-Known Models in utils.sh Source: https://github.com/anomalyco/models.dev/blob/dev/providers/cloudflare-ai-gateway/README.md Add specific well-known models to the `WELL_KNOWN_MODELS` array in `scripts/utils.sh` to ensure they are recognized. Existing patterns should be maintained. ```bash WELL_KNOWN_MODELS=( # ... existing patterns ... "openai/gpt-5$" ) ``` -------------------------------- ### Fetch and Use Model Data with Vercel AI SDK Source: https://context7.com/anomalyco/models.dev/llms.txt Fetch model data from the Models.dev API, extract specific model configurations, and use them to dynamically configure the Vercel AI SDK for text generation. Ensure to handle potential errors during fetch and JSON parsing. ```typescript import { anthropic } from "@ai-sdk/anthropic"; import { openai } from "@ai-sdk/openai"; import { google } from "@ai-sdk/google"; import { generateText } from "ai"; // Fetch model data from API const response = await fetch("https://models.dev/api.json"); const providers = await response.json(); // Get model configuration const modelConfig = providers.anthropic.models["claude-sonnet-4-5"]; console.log(`Using ${modelConfig.name}`); console.log(`Context limit: ${modelConfig.limit.context.toLocaleString()} tokens`); console.log(`Cost: $${modelConfig.cost.input}/1M input, $${modelConfig.cost.output}/1M output`); // Use with AI SDK const { text } = await generateText({ model: anthropic("claude-sonnet-4-5"), prompt: "Explain quantum computing", maxTokens: Math.min(1000, modelConfig.limit.output), }); ``` -------------------------------- ### Extend Existing Model Definition Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Use `extends` for wrapper providers mirroring another model. Specify the source model with `from` and optionally omit fields with `omit`. This is for non-first-party wrappers, not canonical lab providers. ```toml [extends] from = "anthropic/claude-opus-4-6" omit = ["experimental.modes.fast"] [provider] npm = "@ai-sdk/anthropic" ``` -------------------------------- ### Generate Weights & Biases Models Source: https://context7.com/anomalyco/models.dev/llms.txt Automatically generates model definitions for the Weights & Biases provider. ```bash # Generate Weights & Biases models bun run wandb:generate ``` -------------------------------- ### Fetch All Model Data via API Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Use this cURL command to retrieve all available AI model data from the Models.dev API. This is useful for bulk operations or initial data loading. ```bash curl https://models.dev/api.json ``` -------------------------------- ### Generate Helicone Models Source: https://context7.com/anomalyco/models.dev/llms.txt Automatically generates model definitions for the Helicone provider. ```bash # Generate Helicone models bun run helicone:generate ``` -------------------------------- ### Claude Sonnet 4.5 Model Configuration Source: https://context7.com/anomalyco/models.dev/llms.txt Configuration for Claude Sonnet 4.5, highlighting its reasoning capabilities and interleaved reasoning token costs. It includes details on attachments, temperature, tool calls, knowledge cutoff, and pricing for input, output, and cache operations. Also specifies context and output limits, and supported modalities. ```toml # providers/anthropic/models/claude-sonnet-4-5.toml name = "Claude Sonnet 4.5 (latest)" family = "claude-sonnet" release_date = "2025-09-29" last_updated = "2025-09-29" attachment = true reasoning = true temperature = true tool_call = true knowledge = "2025-07-31" open_weights = false [cost] input = 3.00 output = 15.00 cache_read = 0.30 cache_write = 3.75 [limit] context = 200_000 output = 64_000 [modalities] input = ["text", "image", "pdf"] output = ["text"] # For models with interleaved reasoning [interleaved] field = "reasoning_content" # or "reasoning_details" ``` -------------------------------- ### Fetch Provider Logo Source: https://context7.com/anomalyco/models.dev/llms.txt Downloads the SVG logo for a specific AI model provider. If a provider-specific logo is not found, a default logo is returned. ```bash # Fetch Anthropic's logo curl https://models.dev/logos/anthropic.svg -o anthropic-logo.svg ``` ```bash # Fetch OpenAI's logo curl https://models.dev/logos/openai.svg -o openai-logo.svg ``` ```bash # Fetch Google's logo curl https://models.dev/logos/google.svg -o google-logo.svg ``` ```bash # If logo doesn't exist, returns default logo curl https://models.dev/logos/unknown-provider.svg -o default-logo.svg ``` -------------------------------- ### Cross-Reference Providers in utils.sh Source: https://github.com/anomalyco/models.dev/blob/dev/providers/cloudflare-ai-gateway/README.md Specify providers for cross-referencing in `scripts/utils.sh` by setting the `CROSS_REFERENCE_PROVIDERS` variable. This is used for mapping Cloudflare model IDs to canonical provider filenames. ```bash CROSS_REFERENCE_PROVIDERS="openai anthropic google" ``` -------------------------------- ### Cloudflare AI Gateway Provider Configuration Source: https://github.com/anomalyco/models.dev/blob/dev/providers/cloudflare-ai-gateway/README.md Defines the configuration for connecting to Cloudflare AI Gateway. Ensure environment variables like `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID`, and `CLOUDFLARE_GATEWAY_ID` are set. ```toml name = "Cloudflare AI Gateway" env = ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID", "CLOUDFLARE_GATEWAY_ID"] npm = "@ai-sdk/openai-compatible" api = "https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/compat/" doc = "https://developers.cloudflare.com/ai-gateway/" ``` -------------------------------- ### Fetch Provider Logos via API Source: https://github.com/anomalyco/models.dev/blob/dev/README.md Retrieve SVG logos for AI model providers using this cURL command. Replace `{provider}` with the specific provider ID. A default logo is served if a provider's logo is not found. ```bash curl https://models.dev/logos/{provider}.svg ``` -------------------------------- ### TOML Model Inheritance Configuration Source: https://github.com/anomalyco/models.dev/blob/dev/AGENTS.md Defines how one model can inherit properties from another using the [extends] table in TOML configuration files. Specify the base model with 'from' and optionally omit fields with 'omit'. ```toml [extends] from = "/" # required omit = ["experimental.modes.fast"] # optional, dot-path strings ``` ```toml from = "anthropic/claude-opus-4-6" ``` -------------------------------- ### Fetch Model Schema Source: https://context7.com/anomalyco/models.dev/llms.txt Retrieves the JSON Schema for model validation. This schema defines the expected format for AI model identifiers. ```bash # Fetch the model schema curl https://models.dev/model-schema.json ``` -------------------------------- ### Skip Namespaces in utils.sh Source: https://github.com/anomalyco/models.dev/blob/dev/providers/cloudflare-ai-gateway/README.md Configure `scripts/utils.sh` to skip specific namespaces by listing them in the `SKIP_NAMESPACES` variable. This prevents models from these namespaces from being processed. ```bash SKIP_NAMESPACES="replicate/replicate-internal my-provider/internal" ``` -------------------------------- ### Generate Venice Models Source: https://context7.com/anomalyco/models.dev/llms.txt Generates model definitions for the Venice provider. An optional API key can be provided for accessing alpha models. ```bash # Generate Venice models (with optional API key for alpha models) VENICE_API_KEY=your_key bun run venice:generate ``` -------------------------------- ### Fetch Provider Logo Source: https://context7.com/anomalyco/models.dev/llms.txt Retrieves the SVG logo for a specified AI model provider. If a provider-specific logo is not found, a default logo is returned. ```APIDOC ## GET /logos/{provider}.svg ### Description Returns SVG logo for a specific provider. Falls back to default logo if provider-specific logo doesn't exist. ### Method GET ### Endpoint /logos/{provider}.svg ### Parameters #### Path Parameters - **provider** (string) - Required - The name of the AI provider (e.g., 'anthropic', 'openai', 'google'). ### Request Example ```bash # Fetch Anthropic's logo curl https://models.dev/logos/anthropic.svg -o anthropic-logo.svg # Fetch OpenAI's logo curl https://models.dev/logos/openai.svg -o openai-logo.svg # Fetch Google's logo curl https://models.dev/logos/google.svg -o google-logo.svg # If logo doesn't exist, returns default logo curl https://models.dev/logos/unknown-provider.svg -o default-logo.svg ``` ### Response #### Success Response (200) - **body** (svg) - The SVG content of the provider's logo or a default logo. #### Response Example (SVG content will be returned directly) ``` -------------------------------- ### Fetch Model Schema Source: https://context7.com/anomalyco/models.dev/llms.txt Retrieves a JSON Schema that defines the structure for valid model identifiers, formatted as 'provider/model'. This is useful for data validation. ```APIDOC ## GET /model-schema.json ### Description Returns a JSON Schema with all valid model identifiers in `provider/model` format for validation purposes. ### Method GET ### Endpoint /model-schema.json ### Request Example ```bash curl https://models.dev/model-schema.json ``` ### Response #### Success Response (200) - **body** (object) - A JSON Schema object defining valid model identifiers. #### Response Example ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://models.dev/model-schema.json", "$defs": { "Model": { "type": "string", "enum": [ "anthropic/claude-haiku-4-5", "anthropic/claude-opus-4-6", "anthropic/claude-sonnet-4-5", "openai/gpt-4o", "openai/gpt-5", "google/gemini-2.5-pro", ... ], "description": "AI model identifier in provider/model format" } } } ``` ``` -------------------------------- ### Provider Definition TOML Source: https://context7.com/anomalyco/models.dev/llms.txt Defines an AI provider, including authentication environment variables, npm package, and documentation URL. Supports custom API endpoints. ```toml # providers/anthropic/provider.toml name = "Anthropic" env = ["ANTHROPIC_API_KEY"] дает = "@ai-sdk/anthropic" doc = "https://docs.anthropic.com/en/docs/about-claude/models" ``` ```toml # OpenAI-compatible provider example # providers/custom-provider/provider.toml name = "Custom Provider" env = ["CUSTOM_API_KEY"] дает = "@ai-sdk/openai-compatible" api = "https://api.custom-provider.com/v1" doc = "https://docs.custom-provider.com/models" ``` -------------------------------- ### Model Name Mappings in data/model_names.json Source: https://github.com/anomalyco/models.dev/blob/dev/providers/cloudflare-ai-gateway/README.md Provide human-readable names for models in `data/model_names.json`. This JSON file maps canonical model IDs to display names. ```json { "workers-ai/llama-3-8b-instruct": "Llama 3 8B Instruct", "openai/gpt-4o": "GPT-4o", "anthropic/claude-3.5-sonnet": "Claude 3.5 Sonnet" } ``` -------------------------------- ### Generated TOML Structure for AI Models Source: https://github.com/anomalyco/models.dev/blob/dev/providers/cloudflare-ai-gateway/README.md This TOML structure defines configuration parameters for AI models, including name, release dates, cost per token, and capability limits. It is used for models auto-generated by the Cloudflare AI Gateway provider. ```toml name = "Model Name" release_date = "2024-01-01" last_updated = "2024-01-01" attachment = false reasoning = false temperature = true tool_call = false open_weights = false [cost] input = 0.15 # USD per 1M input tokens output = 0.60 # USD per 1M output tokens [limit] context = 128000 # Max context tokens output = 16384 # Max output tokens [modalities] input = ["text"] output = ["text"] ``` -------------------------------- ### Find Reasoning Models from Provider Data Source: https://context7.com/anomalyco/models.dev/llms.txt Filter AI model providers to find models that support reasoning and are not deprecated. This function iterates through nested provider and model data structures. ```typescript // Dynamic provider selection based on capabilities function findReasoningModels(providers: Record) { const results: Array<{ provider: string; model: string; name: string }> = []; for (const [providerId, provider] of Object.entries(providers)) { for (const [modelId, model] of Object.entries(provider.models as Record)) { if (model.reasoning === true && model.status !== "deprecated") { results.push({ provider: providerId, model: modelId, name: model.name, }); } } } return results; } const reasoningModels = findReasoningModels(providers); // Returns: [ // { provider: "anthropic", model: "claude-sonnet-4-5", name: "Claude Sonnet 4.5 (latest)" }, // { provider: "google", model: "gemini-2.5-pro", name: "Gemini 2.5 Pro" }, // { provider: "openai", model: "o1", name: "o1" }, // ... // ] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.