Guida rapida all'API di SpeakNotes
Crea una chiave, effettua la tua prima chiamata nella sandbox, quindi passa all'ambiente live. Quattro passaggi, tutti in curl.
1. Crea una chiave
Apri Impostazioni, Chiavi API e creane una. Scegli la sandbox durante la fase di sviluppo: le chiavi sandbox restituiscono un output fisso, non consumano crediti e scrivono in una libreria separata che puoi eliminare.
2. Riassumi qualcosa nella sandbox
Ogni percorso funziona con una chiave sandbox. La struttura della risposta è identica a quella live, quindi puoi sviluppare con sicurezza.
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. Passa a una chiave live
Stessa richiesta, chiave diversa. Questa esegue il modello reale e addebita crediti; la risposta ti indica quanti ne sono stati utilizzati e quanti ne rimangono.
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": 24. Carica un file
I file multimediali più lunghi vengono elaborati in background. Crea il caricamento, esegui il PUT del file sull'URL firmato, contrassegnalo come completato, quindi interroga la nota finché il suo stato non diventa Done.
# 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"Esplorare l'API
GET /v1 non richiede credenziali e restituisce le risorse, gli ambiti (scopes), i limiti di frequenza, i costi in crediti e le modalità di autenticazione. È il modo più rapido per un agente per orientarsi.
curl https://api.speaknotes.io/v1 # Returns the resources, scopes, rate limits, credit costs, # and how to authenticate. No credential required.
Successivo: autenticazione e ambiti, codici di errore e costi di ogni operazione.