Skip to content
DaneshyarDocs
Sign in
  • Introduction
  • Quickstart
  • What is Daneshyar?
  • The Apps page
  • Inside an app
  • Workspace: files and chat
  • Sharing and members
  • Notes and dictation
  • Language practice
  • Appointment booking
  • Automations
  • The file reader
  • Your profile
  • Wallet
  • Customer chats
  • API keys
  • Authentication
  • Apps, workspaces, resources
  • Ingestion
  • Chat and sessions
  • Citations
  • Skills
  • Conventions
  • Workspaces
  • Resources
  • Chat
  • Skills
  • Errors
  • Customer support assistant
  • Internal knowledge base
  • Documentation chatbot
  • Academy tutor
  • Embedded widget
  • Widget configuration
  • Framework guides
  • Security
  • Troubleshooting
  • FAQ
  1. Docs
  2. Authentication
  3. API keys

API keys

Your two keys — secret and widget — where they come from, exactly what each can do, and how to hold them safely.

Each app has two keys. The secret key (sk_…) is the only credential this API accepts, and it carries the full authority of the account that owns the app. The widget key (pk_…) is public and can only ask questions through the widget.

Finding your keys

Open the console, choose an app, and find the Secret key card in the right-hand column of the app page. Press Create key and copy it at once: we store only a fingerprint of it, so it can never be shown again. Lost it? Make a new one.

sk_9f3aC2xQ7mB1vT8sE4nK6pR0jY5wZ2hL

Keys are opaque strings prefixed with dk_live_. Treat the whole string as the secret — there is no separate id and secret pair.

What the secret key can do

The secret key authenticates as the user who owns the app. That is broader than it may look, so it is worth stating plainly. A holder of the secret key can:

  • List, create, rename and delete any workspace under the app.
  • Upload documents into any of those workspaces, and delete them.
  • Read every resource's file_url, which is a direct link to the stored original document.
  • Ask questions and read the chat history of any end user in any of those workspaces.
Anyone who obtains the secret key can delete an entire workspace and download every document in it. The widget key cannot do any of this — it can only ask questions, and its answers carry no sources.

Keeping it safe

Which leads to a short list of rules:

  • Call the API from your backend only. Not from a browser, a mobile app, a desktop app, or a build artefact your users can download.
  • Read it from an environment variable or a secret manager. Never commit it, and never put it in a client-side bundle where a build step could inline it.
  • If your users need to ask questions from a browser, proxy through your own server: your frontend calls your API, your API holds the secret key. That also lets you enforce your own rate limits, which this API does not yet have.
  • Send a different external_user_id per end user, so the transcripts you store stay separated even though they share one secret key.

Rotation and revocationOn the roadmap: Soon

Each key has its own Regenerate and Delete buttons on the app page. Both work at once: the old key stops working the moment you press the button. After a delete, the app has no key of that kind until you press Create key. You can change keys up to 10 times an hour.

There is no overlap period. A new secret key breaks every server using the old one, and a new widget key breaks every pasted snippet, until you swap in the new one — so have it ready to deploy before you press Regenerate.

The widget uses its own public key, not this one. Before you embed it, read Security.

PreviousCustomer chatsNextAuthentication

On this page

  • Finding your keys
  • What the secret key can do
  • Keeping it safe
  • Rotation and revocation

Every example on this site runs against the live API. If one doesn't, tell us — that's a bug in the docs.

ServicesAboutTalk to us