تخطَّ إلى المحتوى

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

  1. Navigate to Connections in the sidebar
  2. Click Add Connection
  3. Select a provider (ChatGPT or Google Savio)
  4. Give it a label (e.g., “My ChatGPT Account”)
  5. Follow the provider-specific instructions to activate the connection

Step 3: Create an API Key

  1. Navigate to API Keys in the sidebar
  2. Click Create API Key
  3. Give it a name (e.g., “My App”)
  4. Copy the key — it won’t be shown again

Step 4: Set Your Environment Variable

Terminal window
export GHOSTMIND_API_KEY="sk-gm-..."

Step 5: Send Your First Request

cURL

Terminal window
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