Anthropic Sprite Connector

Hey all, can someone tell me if the Anthropic connector for Sprites is meant to be used with the Claude CLI agent? I configured the connector, restarted my Sprite, and it keeps saying:
Not logged in * Please run /login

I thought the purpose was so I didn’t have to configure my login with Claude manually inside the container storing the secret in there.

It’s only intended as a way to give your sprite access to the Anthropic API. It doesn’t auto-configure claude code to use an API token, for example. You’d have to trick the CC binary into using the connector to achieve that.

If you want to use a subscription for claude code, there’s no way around doing the login dance, as far as I’m aware.

Ah, looks like CC does respond to a ANTHROPIC_BASE_URL env var, so you could configure CC to use the connector URI by setting that before launching it.

Reminder though, this would mean you’re using CC with API pricing rather than your subscription.

Hi, subscriptions now come with external API credits now:

I wanted to use my API credits with a Sprite. This connector isn’t very useful if I still have to manually configure the agent.

So I think once you “redeem” your credit, you would need to generate a Claude API token, put that into a connector and then set the env var above before invoking claude.

The connector is to avoid placing credentials on the Sprite, and also so that new Sprites can have instant access to any services you’ve provisioned as connectors.

You can query connectors from within a sprite, e.g.

ANTHROPIC_BASE_URL=$(curl -s https://api.sprites.dev/v1/gateway/list | jq '.connections[] | select(.display_name == "Anthropic API") | .gateway_base_url') claude

is how you could launch claude if you named your connector Anthropic API. If you keep that somewhere easy to copy/paste, then you’re golden.

Can I set that env variable permanently in a Sprite?

Yeah you should be able to by adding the following to your Sprite’s ~/.bashrc (or ~/.zshrc if using Zsh):

export ANTHROPIC_BASE_URL="$(curl -fsS https://api.sprites.dev/v1/gateway/list | jq -r '.connections[] | select(.display_name == "Anthropic API") | .gateway_base_url')"

This should load the connector URL automatically in new shell sessions.

Got it! I hadn’t thought of that, thanks!