workspace-course-topics

Configure Matsya to use your Anthropic API key

Timing: Assigned in Class 11, due before Class 12 — see run manifest (#131) and Assignments for Class 12.

Scope: This assignment is only about credentials and billing: Matsya access token, MATSYA_ANTHROPIC_KEY, shell persistence, and a one-line smoke test that Matsya runs. Named sessions (--session) are a separate assignment (#132)—do them after this one.

Prerequisites: Matsya installed (pip install git+https://github.com/econ-ark/matsya.git), Matsya token (msy_...) from the instructor, and a ballpark clone.


Goal

Route Matsya’s LLM leg to your Anthropic account when possible via MATSYA_ANTHROPIC_KEY. Matsya does not use generic ANTHROPIC_API_KEY; see the README — optional own key.

Rough costs: A $5–$10 starter credit is usually enough to begin; many single queries are order-of-magnitude ~$0.15–$0.30 (not a guarantee—watch the Anthropic console). If your key errors or runs out, Matsya may fall back to the shared project key and say so in the reply.

Why the ballpark directory: Keeps your terminal and local AI anchored to the repo you use for the rest of the course.

Questions about Matsya may be forwarded to the Econ-ARK / Matsya contact on file.


Steps

1. Open your ballpark and a terminal

Open the ballpark in Cursor (or your editor), then an integrated terminal.

2. cd to the ballpark root

cd /path/to/your-ballpark-repo
pwd

3. Guided prompts (Composer / Claude Code)

Use one thread. Copy A–D in order.

Prompt A — README (install / configure / key only)

Read https://github.com/econ-ark/Matsya README sections on Install, Configure, CLI quick start, and "Using your own Anthropic API key". Summarize what Matsya is for and the exact steps to run a first query from the terminal. Skip deep detail on multi-turn sessions—we cover that in the next assignment.

Prompt B — two credentials

Explain Matsya token (msy_...) vs MATSYA_ANTHROPIC_KEY: what each does, where matsya configure stores the token, and why ANTHROPIC_API_KEY alone is not enough for Matsya.

Prompt C — shell startup

Explain ~/.bashrc vs ~/.zshrc on my OS. Ask me to paste Matsya-related lines with secrets redacted; check they load for Cursor’s terminal.

Prompt D — smoke test

With MATSYA_ANTHROPIC_KEY exported in this shell if we use my key, run: matsya "What is Dolo Plus?"
Show terminal output; fix errors using the README.

Have the assistant actually run the command in the project terminal.


Deliverables

Submit brief evidence (format per course channel):

  1. Confirmation that MATSYA_ANTHROPIC_KEY is set for the shell you use with Matsya (state that it is set—never paste the key).
  2. Terminal output (short excerpt) from a successful matsya "What is Dolo Plus?" run or error + what you tried next.
  3. One sentence on whether a fallback to the shared key notice appeared.

References