Create an API key to authenticate requests to Token Factory models from your project. One key works with every model, and the model ID in each request decides which model answers. Token Factory API keys are separate from TIR Personal Access Tokens, which do not work with Token Factory.
Create the key
Section titled “Create the key”-
In TIR, open a project. In the side menu, under INFERENCE, select Token Factory, then select API Keys.
-
Select Create API Key. On a model’s page, Create API key opens the same form. A project can have up to 25 active API keys; at the limit, revoke a key you no longer use before you create another. On a prepaid account, you need a credit balance above zero to create a key.
-
In Name, say where you will use the key, in up to 100 characters; for example,
productionorci-tests. Every key needs a name, and a clear one helps you pick the right key to block or revoke later. -
In Expires, choose how long the key works. Requests with the key fail once it expires.
- Never suits a key held by a server you control.
- In 30 days, In 90 days, or In 1 year suits a key for a test, a contractor, or a tool you try out, so it stops on its own.
You cannot change the name or expiry later. To change either, create a new key and revoke the old one.
-
Select Create Key.
Copy the key
Section titled “Copy the key”Copy your new API key shows the key once. TIR does not keep a copy, so a key you do not copy now cannot be shown again; if that happens, create a new key instead.
- Copy the key and store it somewhere safe, such as your secret manager or an environment variable on the server that uses it.
- Tick I have copied the API key., then select Done.
The key now appears on API Keys with the status Active. The Key column shows only the start and the last four characters of each key, so you can tell keys apart without exposing them. Created By shows who created each one.
To use the key, see Call a model with the OpenAI SDK or Call a model with REST. If a key is lost or leaked, block or revoke it. For help with a message when you create a key, see Troubleshooting TIR Token Factory.
Was this page helpful?