Skip to main content
  1. Sign up — Create an account at platform.respan.ai
  2. Create an API key — Generate one on the API keys page
  3. Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page

What is span logging?

  1. Send a POST request to log your AI conversations
  2. See them appear instantly on your Respan platform

Use span logging API

1. Get your Respan API key

After you create an account on Respan, you can get your API key from the API keys page.
Create API key placeholder

2. Integrate Async Span Logging into your codebase

import requests
import json

url = "https://api.respan.ai/api/request-logs/create/"
payload = {
    "model": "gpt-4o",
    "log_type": "chat",
    "input": json.dumps([
        {
            "role": "user",
            "content": "How can I help a customer with a billing issue?"
        }
    ]),
    "output": json.dumps({
        "role": "assistant",
        "content": "I'd be happy to help with billing issues. First, let me check your account details..."
    }),
    "customer_identifier": "support_agent_001"
}

headers = {
    "Authorization": "Bearer YOUR_RESPAN_API_KEY",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, json=payload)

3. Check your spans on the platform

After you integrate the async span logging into your codebase and send the request successfully, you can check your spans on the Spans page.
Logs page placeholder