- Create an account, add a connector slug, copy the API key once.
- In the GPT action / Apps SDK handler, POST phrase + tool_name with platform
chatgpt. Do not call from the model prompt. - Confirm at your dashboard. Optional: outcome, latency_ms, result_count.
A logging failure must not change the action result. Use a short timeout and ignore errors.
Node / TypeScript
await fetch("https://www.locksteps.ai/v1/analytics/ingest", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
connector_id: "YOUR_CONNECTOR_ID",
platform: "chatgpt",
phrase: userPhrase,
tool_name: "your_action",
ts: new Date().toISOString(),
event_id: crypto.randomUUID(),
session_id: sessionId, // one id per chat; reuse for FREE conversions
}),
});
Python
import json
from datetime import datetime, timezone
from urllib.request import Request, urlopen
INGEST_URL = "https://www.locksteps.ai/v1/analytics/ingest"
# phrase is what the person asked. user_intent and query are accepted aliases.
def log_connector_event(connector_id, api_key, phrase, tool_name, event_id, platform=None):
payload = {
"connector_id": connector_id,
"platform": platform,
"phrase": phrase,
"tool_name": tool_name,
"ts": datetime.now(timezone.utc).isoformat(),
"event_id": event_id,
}
request = Request(
INGEST_URL,
data=json.dumps(payload).encode(),
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
method="POST",
)
with urlopen(request, timeout=2) as response:
response.read()
Endpoint: https://www.locksteps.ai/v1/analytics/ingest. Field reference: ingest API. Product hook: for plugin developers.