Haimaker.ai Logo

Grok 2

xai/grok-2
Chat
Xai|
Function CallingWeb Search
Context Window
131K
tokens
Max Output
131K
tokens
Input Price
$2.00
/1M tokens
Output Price
$10.00
/1M tokens

Overview

Grok 2 is a chat model by Xai. It supports a 131K token context window. Supports function calling, web search.

Features & Capabilities

Modechat
Context Window131K tokens
Max Output131K tokens
Function CallingSupported
Vision-
Reasoning-
Web SearchSupported
Url Context-

API Usage

from openai import OpenAI

client = OpenAI(
    base_url="https://api.haimaker.ai/v1",
    api_key="YOUR_API_KEY",
)

response = client.chat.completions.create(
    model="xai/grok-2",
    messages=[
        {"role": "user", "content": "Hello, how are you?"}
    ],
)

print(response.choices[0].message.content)

Use Grok 2 with the haimaker API

OpenAI-compatible endpoint. Start building in minutes.

Get API Access

More from Xai