Finetuning.aiFinetuning.ai

Authentication

Authenticate with the Finetuning.ai API using your API key

All requests to the Finetuning.ai API must include a valid API key.

API Key

API access is available on Pro and Lifetime plans.

Include your key in the X-API-Key header:

curl https://pub.finetuning.ai/v1/me \
  -H "X-API-Key: ft_live_your_key_here"

Keys start with ft_live_ followed by 32 hex characters.

Getting your API key

  1. Log in to your account at finetuning.ai
  2. Go to Profile > API tab
  3. Click Create Key and give it a name
  4. Copy the key immediately — it is shown only once and cannot be retrieved later

You can have up to 5 active API keys per account. Each key shows its name, prefix, and last used date in the key list.

Revoking a key

Revoke a key from the Profile > API tab. Revoked keys are permanently deactivated and cannot be restored.

Security best practices

Never expose your API key in client-side code, public repositories, or browser requests.

  • Use environment variables — Store your key in .env files, not in source code
  • Server-side only — Make API calls from your backend, never from the browser
  • Rotate regularly — If a key is compromised, revoke it immediately and create a new one
  • Limit scope — Use separate keys for development and production

Example: Using environment variables

.env
FINETUNING_API_KEY=ft_live_your_key_here
server.js
const apiKey = process.env.FINETUNING_API_KEY;

const response = await fetch('https://pub.finetuning.ai/v1/me', {
  headers: { 'X-API-Key': apiKey },
});

Authentication errors

Status CodeMeaning
401Missing or invalid API key
403API key valid but insufficient permissions
429Rate limit exceeded — slow down

See the Errors page for a full list of error codes.

On this page