For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://modelgates.ai/docs/_mcp/server.

Free Models Router

The Free Models Router (modelgates/free) automatically selects a free model at random from the available free models on ModelGates. The router intelligently filters for models that support the features your request needs, such as image understanding, tool calling, and structured outputs.

Overview

Instead of manually choosing a specific free model, let the Free Models Router handle model selection for you. This is ideal for experimentation, learning, and low-volume use cases where you want zero-cost inference without worrying about which specific model to use.

To try the Free Models Router without writing any code, see the Chat Playground guide.

Usage

Set your model to modelgates/free:

typescript
import { ModelGates } from '@modelgates/sdk'; const modelgates = new ModelGates({  apiKey: '<MODELGATES_API_KEY>',}); const completion = await modelgates.chat.send({  model: 'modelgates/free',  messages: [    {      role: 'user',      content: 'Hello! What can you help me with today?',    },  ],}); console.log(completion.choices[0].message.content);// Check which model was selectedconsole.log('Model used:', completion.model);
typescript
const response = await fetch('https://modelgates.ai/api/v1/chat/completions', {  method: 'POST',  headers: {    'Authorization': 'Bearer <MODELGATES_API_KEY>',    'Content-Type': 'application/json',  },  body: JSON.stringify({    model: 'modelgates/free',    messages: [      {        role: 'user',        content: 'Hello! What can you help me with today?',      },    ],  }),}); const data = await response.json();console.log(data.choices[0].message.content);// Check which model was selectedconsole.log('Model used:', data.model);
python
import requestsimport json response = requests.post(  url="https://modelgates.ai/api/v1/chat/completions",  headers={    "Authorization": "Bearer <MODELGATES_API_KEY>",    "Content-Type": "application/json",  },  data=json.dumps({    "model": "modelgates/free",    "messages": [      {        "role": "user",        "content": "Hello! What can you help me with today?"      }    ]  })) data = response.json()print(data['choices'][0]['message']['content'])# Check which model was selectedprint('Model used:', data['model'])
bash
curl https://modelgates.ai/api/v1/chat/completions \  -H "Authorization: Bearer $MODELGATES_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "modelgates/free",    "messages": [{"role": "user", "content": "Hello!"}]  }'

Response

The response includes the model field showing which free model was actually used:

json
{  "id": "gen-...",  "model": "upstage/solar-pro-3:free",  "choices": [    {      "message": {        "role": "assistant",        "content": "..."      }    }  ],  "usage": {    "prompt_tokens": 12,    "completion_tokens": 85,    "total_tokens": 97  }}

How It Works

  1. Request Analysis: Your request is analyzed to determine required capabilities (e.g., vision, tool calling, structured outputs)
  2. Model Filtering: The router filters available free models to those supporting your request's requirements
  3. Random Selection: A model is randomly selected from the filtered pool
  4. Request Forwarding: Your request is forwarded to the selected free model
  5. Response Tracking: The response includes metadata showing which model was used

Available Free Models

The Free Models Router selects from all currently available free models on ModelGates. Some popular options include:

Free model availability changes frequently. Check the models page for the current list of free models.

  • DeepSeek R1 (free) - DeepSeek's reasoning model
  • Llama models (free) - Various Meta Llama models
  • Qwen models (free) - Alibaba's Qwen family
  • And other community-contributed free models

Pricing

The Free Models Router is completely free. There is no charge for:

  • Using the router itself
  • Requests routed to free models

Use Cases

  • Learning and experimentation: Try AI capabilities without any cost
  • Prototyping: Build and test applications before committing to paid models
  • Low-volume applications: Suitable for personal projects or demos
  • Education: Perfect for students and educators exploring AI

Limitations

  • Rate limits: Free models may have lower rate limits than paid models
  • Availability: Free model availability can vary; some may be temporarily unavailable
  • Performance: Free models may have higher latency during peak usage
  • Model selection: You cannot control which specific model is selected (use the :free variant suffix on a specific model if you need a particular free model)

Selecting Specific Free Models

If you prefer to use a specific free model rather than random selection, you can:

  1. Use the :free variant: Append :free to any model that has a free variant:
json
{  "model": "meta-llama/llama-3.2-3b-instruct:free"}
  1. Browse free models: Visit the models page to see all available free models and select one directly.