Quick Start
example.ts
// Quick Start Example
import { HeyGrok } from '@heygrok/sdk';
const grok = new HeyGrok({
apiKey: process.env.HEYGROK_API_KEY
});
// Simple chat completion
const response = await grok.chat({
messages: [
{ role: 'user', content: 'Explain quantum computing in simple terms' }
],
model: 'grok-2-latest'
});
console.log(response.content);
// "Imagine a regular computer as a person who can only
// check one path in a maze at a time..."API Endpoints
POST
/v1/chat/completionsGenerate AI responses for conversationsPOST
/v1/embeddingsCreate vector embeddings for textPOST
/v1/images/analyzeAnalyze and describe imagesPOST
/v1/code/executeExecute code in a sandboxed environmentGET
/v1/modelsList available AI modelsGET
/v1/usageCheck your API usage and limitsWhy Developers Love Our API
Blazing Fast
Average response time under 200ms. Built on edge infrastructure for minimal latency worldwide.
Enterprise Security
SOC 2 Type II certified, end-to-end encryption, and comprehensive audit logs.
Global CDN
Deployed across 200+ edge locations. Fast responses no matter where your users are.
Developer First
SDKs for JavaScript, Python, Go, Ruby, and more. Comprehensive docs and examples.