Inicio rápido de la API de SpeakNotes
Crea una clave, realiza tu primera llamada en el sandbox y luego cambia a producción. Cuatro pasos, todo en curl.
1. Crea una clave
Abre Configuración, Claves de API y crea una. Elige sandbox mientras estás desarrollando: las claves de sandbox devuelven resultados fijos, no gastan créditos y escriben en una biblioteca separada que puedes eliminar.
2. Resume algo en el sandbox
Cada ruta funciona con una clave de sandbox. La forma de la respuesta es idéntica a la de producción, por lo que puedes desarrollar sobre ella con confianza.
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. Cambia a una clave de producción
Misma solicitud, diferente clave. Esta ejecuta el modelo real y consume créditos, y la respuesta te indica cuántos se utilizaron y cuántos quedan.
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. Sube un archivo
Los archivos multimedia más largos se procesan en segundo plano. Crea la carga, envía el archivo mediante PUT a la URL firmada, márcalo como completado y luego consulta el estado de la nota hasta que esté lista.
# 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"Descubriendo la API
GET /v1 no necesita credenciales y devuelve los recursos, alcances, límites de tasa, costos de crédito y cómo autenticarse. Es la forma más rápida para que un agente se oriente.
curl https://api.speaknotes.io/v1 # Returns the resources, scopes, rate limits, credit costs, # and how to authenticate. No credential required.
Siguiente: autenticación y alcances, códigos de error y lo que cuesta cada operación.