---
title: Missing credentials
path: troubleshooting/missing-credentials
status: published
---

# Missing credentials

## Symptom

You run `scaiflux`, `scaiflux repl`, or `scaiflux prompt "..."` and
see one of:

```text
No model configured. Pass --model <slug>, set `model` in .scaiflux.json,
or run `scaiflux setup` to configure ScaiFlux for the first time.
```

```text
ScaiFlux has no credentials configured. Run `scaiflux setup` to do
the first-time configuration (endpoint + API key + default model).
```

```text
AuthError: No inference credentials found. Run `scaiflux login` to
authenticate with ScaiKey, or set SCAIGRID_API_KEY + SCAIGRID_BASE_URL
(or OPENAI_API_KEY for a BYO OpenAI-compatible backend).
```

## What it means

ScaiFlux has no way to talk to a model. It looks in three places, in
order, and gives up if none have anything usable:

1. `SCAIGRID_API_KEY` + `SCAIGRID_BASE_URL` environment variables.
2. A stored session at `~/.scaiflux/credentials.json` (written by
   `scaiflux setup` or `scaiflux login`).
3. `OPENAI_API_KEY` (+ optional `OPENAI_BASE_URL`) for a BYO
   OpenAI-compatible backend.

If none are set, the runtime aborts before it can do anything.

## Fix

**Easiest** — run the wizard:

```bash
scaiflux setup
```

Three prompts: endpoint (defaults to ScaiLabs), API key (paste an
`sgk_live_...` key from your ScaiKey dashboard), default model. The
wizard writes `~/.scaiflux/credentials.json` (mode 0600) and you're
done.

**Headless / scripted** — set env vars instead:

```bash
export SCAIGRID_BASE_URL="https://scaigrid.scailabs.ai"
export SCAIGRID_API_KEY="sgk_live_..."
scaiflux prompt "say hi"
```

These environment variables override any stored session, so they're
also the cleanest way to test a different key without disturbing your
default config.

**Already ran setup but still seeing this** — check whether the
credentials file is where ScaiFlux looks for it:

```bash
ls -la ~/.scaiflux/credentials.json
scaiflux doctor
```

The `doctor` report tells you exactly which credential source it
resolved (or which check failed). If the file exists but the wrong
user owns it (e.g. you ran `setup` under `sudo` and your
non-sudo user can't read it), fix the ownership or re-run `setup`
without sudo.

## Related

- [Install](../install) — get ScaiFlux on a machine.
- [Quickstart](../quickstart) — from zero to your first prompt.
