Custom Integration

If you're using a platform not listed in our integration guides, you can integrate FlautoPsy with any application that can make HTTP requests.

Get Your Webhook URL

  1. Log in to FlautoPsy at https://flautopsy.stralocroft.com/dashboard
  2. Go to Settings → Setup (or /setup)
  3. Copy your unique webhook URL (looks like
    text
    https://flautopsy.stralocroft.com/api/webhook?workspace_id=...
    )

HTTP Request Format

Send a POST request to your webhook URL with the following JSON body:

URL

text
POST https://flautopsy.stralocroft.com/api/webhook?workspace_id=YOUR_WORKSPACE_ID

Headers

text
Content-Type: application/json

No authentication header is needed — your workspace ID is in the URL.

Request Body

json
{
"workflow_id": "string (required)",
"prompt": "string (optional)",
"output": "string (required)",
"latency_ms": number (required),
"cost_tokens": number (required),
"model": "string (required)"
}

Field Definitions

| Field | Type | Required | Description | |-------|------|----------|-------------| |

text
workflow_id
| string | Yes | Unique identifier for this workflow (e.g.,
text
"email-classifier"
) | |
text
prompt
| string | No | The prompt sent to the LLM (max 10,000 chars) | |
text
output
| string | Yes | The LLM's response (max 10,000 chars) | |
text
latency_ms
| number | Yes | Milliseconds to get the response | |
text
cost_tokens
| number | Yes | Total tokens used (prompt + completion) | |
text
model
| string | Yes | Model name (e.g.,
text
"gpt-4"
,
text
"claude-3-opus"
) |

Example: cURL

bash
curl -X POST https://flautopsy.stralocroft.com/api/webhook?workspace_id=YOUR_WORKSPACE_ID \
-H "Content-Type: application/json" \
-d '{
"workflow_id": "email-classifier",
"prompt": "Classify this email as spam or not",
"output": "not-spam",
"latency_ms": 245,
"cost_tokens": 1250,
"model": "gpt-4"
}'

Replace

text
YOUR_WORKSPACE_ID
with the actual ID from your webhook URL.

Example: Python

python
import requests
import time
# Replace with your actual webhook URL
webhook_url = "https://flautopsy.stralocroft.com/api/webhook?workspace_id=YOUR_WORKSPACE_ID"
# Your LLM call happens here
start_time = time.time()
output = "not-spam" # Your LLM result
latency_ms = int((time.time() - start_time) * 1000)
# Send to FlautoPsy
payload = {
"workflow_id": "email-classifier",
"prompt": "Classify this email as spam or not",
"output": output,
"latency_ms": latency_ms,
"cost_tokens": 1250,
"model": "gpt-4"
}
response = requests.post(webhook_url, json=payload)
print(response.status_code) # Should be 200

Example: Node.js

javascript
const fetch = require('node-fetch');
async function sendToFlautoPsy() {
const webhookUrl = 'https://flautopsy.stralocroft.com/api/webhook?workspace_id=YOUR_WORKSPACE_ID';
const payload = {
workflow_id: 'email-classifier',
prompt: 'Classify this email as spam or not',
output: 'not-spam',
latency_ms: 245,
cost_tokens: 1250,
model: 'gpt-4'
};
const response = await fetch(webhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
});
console.log(response.status); // Should be 200
}

Response Format

On success, you'll receive a 200 OK response:

json
{
"success": true,
"trace_id": "trace_abc123def456",
"message": "Trace recorded"
}

Error Responses

  • 400 Bad Request — Missing required fields or invalid JSON
  • 401 Unauthorized — Invalid workspace ID
  • 429 Too Many Requests — Rate limit exceeded (contact support for limits)
  • 500 Server Error — FlautoPsy internal error (rare)

Best Practices

  1. Send traces as soon as possible after your LLM call completes
  2. Use a consistent
    text
    workflow_id
    for the same workflow (don't change it)
  3. Don't retry failed requests indefinitely — if a request fails after 3 attempts, log it and move on
  4. Measure latency accurately — use server-side timestamps, not client-side
  5. Truncate long outputs to avoid oversized payloads (max 10,000 chars recommended)

Monitoring Traces

Once you've sent at least 10 traces:

  1. Go to FlautoPsy dashboard → Workflows
  2. Click your workflow to see:
    • Individual traces (Traces tab)
    • Alerts triggered (Alerts tab)
    • Baseline stats (Overview tab)

Troubleshooting

"405 Method Not Allowed"

  • Ensure you're using POST, not GET or PUT

"400 Bad Request"

  • Check that the JSON is valid (use a JSON validator)
  • Verify all required fields are present
  • Ensure
    text
    latency_ms
    and
    text
    cost_tokens
    are numbers

Traces not appearing

  • Confirm the HTTP response status is 200
  • Check that
    text
    workflow_id
    is consistent across requests
  • Wait 5-10 seconds and refresh the dashboard

Rate limit exceeded

  • Contact support@stralocroft.com to discuss your usage pattern
  • Consider batching multiple traces into a single request (max 10 per batch)

Next Steps