Blog5 min read

Use SolCard Inference in Goose

Add SolCard Inference to Goose as a custom OpenAI-compatible provider: the Desktop form, the custom_providers JSON file, token limits, and what a session costs.

Contents

To use SolCard Inference in Goose, add a custom provider with the OpenAI Compatible type, point it at https://api.solcardinference.ai/v1/chat/completions, give it your sk-si- key, and list solcard-inference-fast as a model. Goose Desktop has a form for it, and the CLI reads the same provider from a JSON file. Everything about Goose below comes from Goose’s own docs. We haven’t run Goose ourselves, but the API behind it is the one Kilo Code and OpenCode use.

What you need

  • A SolCard Inference API key. Make one on the dashboard’s API keys page. Keys start with sk-si- and are shown once.
  • Some balance or a plan. One prepaid USD balance pays for every key and model; see how billing works.
  • Goose, as the Desktop app or the CLI. Goose’s installation page has both, for macOS, Linux and Windows.

In Goose Desktop: Add Custom Provider

Go to Settings, then Models, then Configure providers, and click Add Custom Provider at the bottom of the window. Fill it in like this:

FieldValue
Provider TypeOpenAI Compatible
Display NameSolCard Inference
API URLhttps://api.solcardinference.ai/v1/chat/completions
Authenticationtick “This provider requires an API key”, paste your sk-si-... key
Available Modelssolcard-inference-fast, solcard-inference-large, solcard-inference-base
Streaming Supporton

Click Create Provider. Goose’s docs say a key entered in Desktop goes into the system keychain.

Pick OpenAI Compatible, even though our API also speaks Anthropic Messages. Goose’s own custom provider example uses the OpenAI engine, and it’s the route the file below follows.

In the CLI: the custom provider file

Run goose configure, choose Custom Providers, then Add A Custom Provider, and answer the same prompts. Or skip the prompts and write the file yourself. Goose’s docs say custom providers live in ~/.config/goose/custom_providers/ on macOS and Linux, and %APPDATA%\Block\goose\config\custom_providers\ on Windows. Save this as solcard_inference.json there:

{
  "name": "solcard_inference",
  "engine": "openai",
  "display_name": "SolCard Inference",
  "api_key_env": "SOLCARD_INFERENCE_API_KEY",
  "base_url": "https://api.solcardinference.ai/v1/chat/completions",
  "models": [
    { "name": "solcard-inference-fast", "context_limit": 1048576 },
    { "name": "solcard-inference-large", "context_limit": 1000000 },
    { "name": "solcard-inference-base", "context_limit": 262144 }
  ],
  "supports_streaming": true,
  "requires_auth": true
}

Then export the key under the name api_key_env points to:

export SOLCARD_INFERENCE_API_KEY=sk-si-...

What each field does, per Goose’s docs:

FieldWhat it’s for
nameThe provider id you pass to --provider and GOOSE_PROVIDER.
engineopenai means the OpenAI-compatible chat format.
api_key_envThe variable Goose reads the key from, so the key stays out of the file.
base_urlThe endpoint. Goose’s example uses the full /v1/chat/completions path.
modelsThe ids Goose lists, each with its context size in tokens.
requires_authMarks the provider as needing a key.

The context sizes are the ones on our models page. Goose’s config files guide warns that a provider key put in config.yaml is ignored, so keep it in the variable or the keychain.

Set the output limit

Every model writes at most 32,768 tokens per request. Goose’s environment variables page says GOOSE_MAX_TOKENS sets the maximum tokens for each response and defaults to a model-specific value. Set it to our cap:

export GOOSE_PROVIDER=solcard_inference
export GOOSE_MODEL=solcard-inference-fast
export GOOSE_MAX_TOKENS=32768

The same page sets the auto-compaction threshold at 0.8 by default, with an absolute trigger at 225,000 tokens, and the earlier of the two applies. So even on Fast’s 1M context, a long session gets summarized around 225,000 tokens unless you raise GOOSE_AUTO_COMPACT_TOKEN_LIMIT. Leaving it there keeps the input each request resends smaller, which is cheaper.

Switching models

Start on solcard-inference-fast, the default above, and move to solcard-inference-large for planning or a bug you can’t pin down. Large always reasons and costs about three times as much. Goose’s CLI commands page lists /model solcard-inference-large to switch mid-session on the same provider. In Desktop, click the model name at the bottom of the app and choose Change Model. Fast, Large or Base compares the three.

Check it works

Check the key and URL from a terminal first:

curl https://api.solcardinference.ai/v1/models \
  -H "Authorization: Bearer sk-si-..."

You should see solcard-inference-fast, -large and -base. Then send Goose one prompt without saving a session:

goose run --provider solcard_inference --model solcard-inference-fast --no-session -t "Say hello in five words."

In Desktop, pick SolCard Inference and give it a small task, such as “Explain what this file does.”

What a session costs

A request on Fast that resends 50,000 tokens of conversation, 45,000 of them cached, and writes 1,500 tokens is about $0.016. A 30-request session is about $0.47 on Fast and about $1.35 on Large. The output limit you set above caps what any one request can write. How billing works has the price list and the plans.

Troubleshooting

These are the API’s codes, from our errors page; Goose may word them differently.

  • 401 invalid_api_key: the key is missing, revoked or unknown. In the CLI, check the variable is set in the shell that started goose.
  • 400 model_not_found: a model id doesn’t match. Use solcard-inference-fast, -large or -base.
  • 400 unsupported_content: an image or file reached the model. Our models take text only.
  • 402 insufficient_balance: top up, then retry.
  • 429 rate_limited: too many requests a minute for your plan.

If Goose answers No api key passed in, its config files guide says the key is probably sitting in config.yaml, where it’s ignored. Edits to the provider file apply from the next session, per Goose’s docs.

FAQ

Can I keep my other providers in Goose? Yes. A custom provider sits next to the ones you have. Switch with /model --provider in a session, or in Desktop’s model picker.

Do I need the Desktop form and the JSON file both? No. Either one creates the same provider file. The form is quicker; the file is easier to copy between machines.

Can I use the built-in OpenAI provider instead? Goose’s docs say it reads OPENAI_HOST and OPENAI_BASE_PATH, so it can reach other OpenAI-compatible endpoints. A custom provider keeps your OpenAI setup untouched and lists our context sizes, so we’d use that.

Can I attach images? No. Our models take text only, and a request with an image is rejected with unsupported_content.

Are my prompts or code stored? No. Prompts and responses are never logged or stored, on any model. Keeps nothing follows one request through.

Bring the prompt that got refused.

Private. No refusals. In the app, or in the tools you already use.

Pay in crypto. No KYC.