Skip to main content
Glama

What is Gateway?

Gateway lets you access AI models from top providers like OpenAI and Anthropic with one API key, unified billing, and zero rate limits.

PropertyDescription
Model ID
grok-2-1212
Creator
xAI
License-
Supported data types

Inputs

Text

Outputs

Text

Token limits

Input token limit

131,072

Output token limit

131,072

Capabilities

Function calling

JSON schema

Structured outputs

Release date
Latest update-
Knowledge cut-off
Reference URLhttps://openrouter.ai/x-ai/grok-2-1212
Hugging Face URL-

Providers

Name
Price
InputOutputCache ReadCache Write
$2
$10
$-
$-

Gateway Code Examples

import { OpenAI } from 'openai' const openai = new OpenAI({ // OpenAI compatible API baseURL: 'https://glama.ai/api/gateway/openai/v1', // Your Glama Gateway API key // https://glama.ai/settings/gateway/api-keys apiKey: GLAMA_API_KEY, }); await openai.chat.completions.create({ messages: [ { role: 'user', content: 'Hello!' } ], // Let Glama choose the best provider model: 'grok-2-1212', // or specify a specific provider... // model: 'xai/grok-2-1212' });