Entwickler

SpeakNotes API-Schnellstart

Erstellen Sie einen Schlüssel, führen Sie Ihren ersten Aufruf in der Sandbox aus und wechseln Sie dann zu Live. Vier Schritte, alles in curl.

1. Einen Schlüssel erstellen

Öffnen Sie die Einstellungen unter API-Schlüssel und erstellen Sie einen. Wählen Sie Sandbox, während Sie entwickeln: Sandbox-Schlüssel geben feste Ausgaben zurück, verbrauchen keine Credits und schreiben in eine separate Bibliothek, die Sie löschen können.

2. Etwas in der Sandbox zusammenfassen

Jede Route funktioniert mit einem Sandbox-Schlüssel. Die Antwortstruktur ist identisch mit der Live-Umgebung, sodass Sie sicher darauf aufbauen können.

curl -X POST https://api.speaknotes.io/v1/summaries \
  -H "Authorization: Bearer sn_test_YOUR_SANDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "We agreed to ship the billing fix on Friday. Sam owns the migration.",
    "styleId": "meeting-notes"
  }'

# {
#   "title": "Sandbox meeting notes",
#   "summary": "## Decisions\n- Sandbox mode confirmed working ...",
#   "styleId": "meeting-notes",
#   "creditsCharged": 0,
#   "notice": "Sandbox response: fixed output, no credits charged."
# }

3. Zu einem Live-Schlüssel wechseln

Gleiche Anfrage, anderer Schlüssel. Dieser führt das echte Modell aus und berechnet Credits. Die Antwort zeigt Ihnen, wie viele verbraucht wurden und wie viele noch übrig sind.

curl -X POST https://api.speaknotes.io/v1/summaries \
  -H "Authorization: Bearer sn_live_YOUR_LIVE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "...", "styleId": "meeting-notes"}'

# Response headers include:
#   X-Credits-Remaining: 1998
# Response body includes:
#   "creditsCharged": 2

4. Eine Datei hochladen

Längere Medien werden im Hintergrund verarbeitet. Erstellen Sie den Upload, führen Sie einen PUT-Befehl für die Datei an die signierte URL aus, markieren Sie ihn als abgeschlossen und fragen Sie dann den Status der Notiz ab, bis sie als Done markiert ist.

# 1. create the note and get a signed upload URL
curl -X POST https://api.speaknotes.io/v1/uploads \
  -H "Authorization: Bearer $SPEAKNOTES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fileName": "standup.m4a", "contentType": "audio/mp4", "styleId": "meeting-notes"}'

# 2. upload the file straight to the signed URL
curl -X PUT "$UPLOAD_URL" -H "Content-Type: audio/mp4" --data-binary @standup.m4a

# 3. tell SpeakNotes the upload finished (this is where credits are charged)
curl -X POST https://api.speaknotes.io/v1/uploads/$NOTE_ID/complete \
  -H "Authorization: Bearer $SPEAKNOTES_API_KEY"

# 4. poll until status is Done, then read the note
curl https://api.speaknotes.io/v1/notes/$NOTE_ID/status \
  -H "Authorization: Bearer $SPEAKNOTES_API_KEY"

curl https://api.speaknotes.io/v1/notes/$NOTE_ID \
  -H "Authorization: Bearer $SPEAKNOTES_API_KEY"

Die API entdecken

GET /v1 benötigt keine Anmeldeinformationen und gibt die Ressourcen, Bereiche, Ratenbegrenzungen, Credit-Kosten und Informationen zur Authentifizierung zurück. Es ist der schnellste Weg für einen Agenten, sich zu orientieren.

curl https://api.speaknotes.io/v1

# Returns the resources, scopes, rate limits, credit costs,
# and how to authenticate. No credential required.

Weiter: Authentifizierung und Scopes, Fehlercodes und die Kosten der einzelnen Operationen.