API Access

API keys let your own code, scripts and integrations call QAnswer without a browser session. Every key you can manage from your personal space is listed on one page: the ones you create yourself, and the ones QAnswer minted for you when you shared an assistant or connected an integration.

Open API Access in the left navigation menu.

One row per key: its name, a badge saying what kind of key it is, the last characters of its value, its expiry date and its credit usage. The three icons on the right copy the key, open its API tab, or delete it.

The API Access page listing several keys, one of them expired, with the sort menu next to the search field

Clicking a key opens its own page. The top shows the key's name, its kind and its masked value, with a copy button and a delete button. Below, three tabs split the rest — Info, Statistics and API — and the page opens on Info.

Create an API key

Click Create API key and fill in the options:

  • Name (required) — a label to identify the key, e.g. the integration it's used for.
  • Access type (optional) — what the key may do with your rights: Read and write by default, Read only or Use only. See Access types below.
  • Expiry date (optional) — the key stops working automatically after this date. Pick a day from the calendar, or type it as DD/MM/YYYY.
  • Question credit quota (optional) — the maximum number of question credits this key can consume.
  • Credit capacity (optional) — the maximum amount this key can spend on provider usage.
The Create API key dialog with every field filled, the access type set to Read only and each optional field showing its clear button

Every optional field can be emptied again from the clear button on its right, so an expiry, a quota or a capacity set by mistake goes back to unlimited in one click.

QAnswer creates the key and takes you straight to its details page. The value is shown there once, in clear, in a banner at the top — with a Copy button.

The banner showing the new key in clear, with a Copy button
You can copy the key again later
The banner is a shortcut right after creation, but it is not your only chance to grab the key — the copy icon on the key's row, and the one on its details page, both copy the full value.

Access types

The access type restricts what a User key may do with your rights. It never adds any: a key cannot do anything your own account cannot.

The Access type field of the Create API key dialog, open on its three options: Read and write, Read only and Use only
  • Read and write – the key acts as you, with all your rights. This is the default.
  • Read only – the key can read whatever you can and use assistants: chat, the /api/v1 chat completions, messages and embeddings endpoints, and searches. Any other change is refused with HTTP 403 (APIKEY_MUTATION_FORBIDDEN) and nothing is executed. It also cannot create or read API keys, export provider credentials or start an OAuth sign-in.
  • Use only – the same calls as Read only, but on every assistant, provider or other resource the key is capped at Use only — the same meaning as when an assistant is shared with that access type: it can chat with the assistant but not see its logs or change its settings.

The access type is shown in the Access Type row of the key's Info tab and cannot be changed after creation: to change it, create a new key and delete the old one.

Give each integration the most restrictive access type it can work with
A chat widget or a reporting script only needs Read only — or Use only when it never reads logs. Keep Read and write for the integrations that create or change assistants, data or settings.

What a key can reach

Every key carries a badge that says what it is for. There are two kinds:

  • User – a key that is not tied to any resource — the kind you create on this page. It acts on your behalf, within its access type: at Read and write, whatever your account can do through the API, this key can do.
  • Assistant – a key bound to exactly one AI assistant. It can only call the endpoints of that assistant — nothing else in QAnswer.

Assistant keys are not created from this page. They are minted on the assistant itself — when you share an AI assistant with an API key or connect it to Slack, Discord or Teams — and then appear here so you can track and revoke them in one place.

An assistant key can chat with and search that assistant, and reach its conversations, data sources and metadata. Everywhere else it is refused.

In particular, an assistant key can never:

  • read or change your profile, your organizations, your teams, or who a resource is shared with;
  • list, create or delete API keys — including itself;
  • reach the administration, billing or branding endpoints;
  • read or export the configuration of a language model, embedder or any other provider;
  • delete or export the assistant it is bound to, or touch any other assistant.
What a refused call looks like
An assistant key used on an unrelated endpoint gets HTTP 401 and a message naming its assistant: “This API key can only be used for the Assistant "Support bot" but you are trying to access an API that is not related to it!”. Nothing is executed — point the call at the right endpoint, or use a User key.
A User key acts as you
A User key is not restricted to a resource, so whoever holds it can act as you through the API, within its access type. When an integration only needs one assistant, give it an assistant key instead, always set an expiry date and a credit quota, and delete the key as soon as it leaves your control.

Use a key

Open a key and select its API tab, or click the book icon on its row to land on it directly. Every API your account can use gets its own card: chat completions, embeddings, speech-to-text and AI assistant chat. Web search and image generation have no snippet — they are used as tools inside an assistant conversation rather than called directly.

A card shows the HTTP method and the path, and expands to a ready-to-run snippet with the key already in the header. One card is open at a time: opening another closes it. The tabs above the snippet switch between cURL, Python and JavaScript, and the Copy button copies the language you are looking at. Where a call needs a model or an assistant, the selector next to the path chooses which one the example uses.

Every endpoint is documented in the API reference, also linked from the top of the section.

The API tab of a user-level key, one endpoint card open on its cURL snippet

For an assistant key the API tab is shorter and says so: it lists only the calls that key is allowed to make, against the assistant it names.

The API tab of an assistant-bound key, showing only the assistant chat call

Track a key's usage

The Info tab of a key's page shows:

  • Expiry — the date the key stops working, or No expiry.
  • Status — Active, or Expired once that date has passed.
  • Access Type — Read and write, Read only or Use only, set when the key was created. See Access types above.
  • Credit session start — the day the current quota period began.
  • Question credits — question credits consumed against the key's quota, as used / total.
  • Credit capacity — the spending limit set at creation, or Unlimited.
  • Credits used — the running total for this key.
The Info tab of an API key's page, showing expiry, status, access type and credit metrics

The Statistics tab shows what the key has consumed this month, with one section per provider family that recorded usage: LLM, embedder, web search, image generation or speech-to-text. Each section has summary figures (calls, tokens, cost), a chart you can switch between Calls, Tokens and Cost ($), a table by day and an Export button. The date fields and the AI Assistant filter narrow the period or the assistant, and the refresh button reloads the figures.

The Statistics tab of an API key's page, showing the LLM section with summary figures and a calls-per-day chart

A key with no usage this month shows “No usage recorded yet for this key.” instead.

Manage your keys

  • The search field filters the list by key name.
  • The sort menu next to it orders the list by Creation date, Name, Expiry date or Credits used. A key with no expiry counts as expiring last.
  • The arrow button right of the sort menu flips between descending and ascending, and its tooltip names the current order. The default is Creation date, descending: the newest key comes first.
  • The grid button after the sort controls switches the list between rows and cards.
  • The Select entry in the three-dot menu at the end of the toolbar turns on multi-selection: tick several keys, then delete them in one operation.
  • The bin icon on a row deletes that single key, after a confirmation.
  • An expired key stays in the list, greyed out and badged Expired, until you delete it. The API refuses it in the meantime.
The sort menu open on the API Access toolbar, listing Creation date, Name, Expiry date and Credits used
Deleting a key takes effect immediately
There is no grace period and no way to restore a deleted key: every application still using it starts failing on its next call. Create the replacement first, deploy it, then delete the old key.