Quickstart
هذا المحتوى غير متوفر بلغتك بعد.
This guide walks you through signing in, connecting an AI account, creating an API key, and making your first chat completion request.
Prerequisites
- A GhostMind account (ask your workspace admin for an invitation)
- A connected AI provider account (ChatGPT or Google Savio)
Step 1: Sign In
Go to ghostmind.optdmsa.com and sign in with your email and password.
Step 2: Connect an AI Account
- Navigate to Connections in the sidebar
- Click Add Connection
- Select a provider (ChatGPT or Google Savio)
- Give it a label (e.g., “My ChatGPT Account”)
- Follow the provider-specific instructions to activate the connection
Step 3: Create an API Key
- Navigate to API Keys in the sidebar
- Click Create API Key
- Give it a name (e.g., “My App”)
- Copy the key — it won’t be shown again
Step 4: Set Your Environment Variable
export GHOSTMIND_API_KEY="sk-gm-..."Step 5: Send Your First Request
cURL
curl https://ghostmind.optdmsa.com/v1/chat/completions \ -H "Authorization: Bearer $GHOSTMIND_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "auto", "messages": [ {"role": "user", "content": "Hello! What is GhostMind?"} ] }'Python
import requests
response = requests.post( "https://ghostmind.optdmsa.com/v1/chat/completions", headers={ "Authorization": "Bearer sk-gm-...", "Content-Type": "application/json", }, json={ "model": "auto", "messages": [ {"role": "user", "content": "Hello! What is GhostMind?"} ], },)
print(response.json())JavaScript
const response = await fetch("https://ghostmind.optdmsa.com/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer sk-gm-...", "Content-Type": "application/json", }, body: JSON.stringify({ model: "auto", messages: [ { role: "user", content: "Hello! What is GhostMind?" } ], }),});
const data = await response.json();console.log(data);Step 6: Read the Response
{ "id": "chatcmpl-abc123", "object": "chat.completion", "model": "auto", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! GhostMind is an AI gateway..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 45, "total_tokens": 57 }}Next Steps
- Authentication — Learn about API key types and scopes
- Your First Request — Deep dive into the request/response format
- Streaming — Use Server-Sent Events for real-time responses
- User Guides — Explore the web app