Quick start with Grok API
Connect Grok to your application or coding tool and receive the first response in a few minutes.
Create an account and API key
Register, confirm your email, and then create a project key in the dashboard. Copy it once, it will not be shown in full again.
Create an accountSave the connection settings
Store credentials in environment variables. Do not commit real keys to git or expose them in browser code.
GROK_API_KEY=sk-grok-YOUR_API_KEY
GROK_BASE_URL=https://api.llm-gate.tech/v1Check the API with cURL
Send a minimal Chat Completions request. A successful response contains choices[0].message.content.
curl https://api.llm-gate.tech/v1/chat/completions \
-H "Authorization: Bearer sk-grok-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.5",
"messages": [{"role": "user", "content": "Reply with: connection works"}],
"stream": false
}'Connect the Python SDK
Install the official OpenAI SDK and pass the GrokAPI base URL to the client.
pip install openaiimport os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["GROK_API_KEY"],
base_url="https://api.llm-gate.tech/v1",
)
response = client.chat.completions.create(
model="grok-4.5",
messages=[{"role": "user", "content": "Hello, Grok"}],
)
print(response.choices[0].message.content)Connect the TypeScript SDK
The same OpenAI-compatible setup works in Node.js and server-side TypeScript applications.
npm install openaiimport OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GROK_API_KEY,
baseURL: "https://api.llm-gate.tech/v1",
});
const response = await client.chat.completions.create({
model: "grok-4.5",
messages: [{ role: "user", content: "Hello, Grok" }],
});
console.log(response.choices[0].message.content);Configure Cursor
Open Cursor Settings → Models, choose an OpenAI-compatible provider, and enter the values below.
Provider: OpenAI Compatible
Base URL: https://api.llm-gate.tech/v1
API Key: sk-grok-YOUR_API_KEY
Model: grok-4.5Configure Cline
Open Cline settings, select OpenAI Compatible, and fill in the base URL, API key, and model ID.
API Provider: OpenAI Compatible
Base URL: https://api.llm-gate.tech/v1
API Key: sk-grok-YOUR_API_KEY
Model ID: grok-4.5How to verify the connection
Ask the model to return a short answer. If streaming text appears and your dashboard balance changes, the connection is ready.