Terminal chat for Mesh API — OpenAI-compatible LLM gateway
Project description
meshapi-code
Terminal chat for Mesh API — the OpenAI-compatible LLM gateway. Streaming responses, live markdown, slash commands, real-time cost.
$ meshapi
╭───────────────────────────────╮
│ meshapi 0.1.0 │
│ model: anthropic/claude-… │
│ route: default │
╰───────────────────────────────╯
you > how do I parse SSE in python
… streamed markdown reply …
142 → 318 tok • $0.001234 • session $0.001234
Install
pipx install meshapi-code # recommended
uv tool install meshapi-code # if you use uv
pip install meshapi-code # plain pip
The PyPI package is meshapi-code; the command on your $PATH is meshapi.
Then:
export MESHAPI_API_KEY=rsk_your_key_here
meshapi
Get a key at meshapi.ai.
What it does
- Streaming completions with live markdown rendering (
rich) - Real cost per turn — Mesh API returns
costin the SSE tail; we show it - Slash commands —
/model,/route,/file,/system,/cost,/clear - Mid-session model switching —
/model openai/gpt-4o-mini - Smart routing —
/route cheapestlets the gateway pick (Mesh-specific) - Persistent input history — up-arrow recalls past prompts
- Config + env-var override —
~/.meshapi/config.json,MESHAPI_API_KEY
Slash commands
| Command | What it does |
|---|---|
/help |
List commands |
/model <name> |
Switch model (e.g. anthropic/claude-sonnet-4.5) |
/route <mode> |
cheapest, fastest, balanced, or default |
/file <path> |
Inject a file into the conversation |
/system <text> |
Replace system prompt and reset chat |
/cost |
Show cumulative session spend |
/clear |
Reset conversation |
/exit |
Quit |
Config
~/.meshapi/config.json:
{
"base_url": "https://api.meshapi.ai/v1",
"model": "anthropic/claude-sonnet-4.5",
"system": "You are a helpful coding assistant. Be concise.",
"route": null
}
The API key is read from MESHAPI_API_KEY (preferred) or stored in the same file.
Why it exists
Mesh API is OpenAI-compatible, so any generic chat CLI works against it. meshapi adds two things a generic CLI can't: (1) the gateway-only cost field shown after every turn, and (2) routing controls (/route cheapest) that hit Mesh's gateway-side model selection.
Roadmap
- v0.2 — tool calling, repo-aware mode, diff apply,
npm i -g meshapi-code - v0.3 — Homebrew tap, curl|sh installer at
meshapi.ai/install.sh
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meshapi_code-0.2.1.tar.gz.
File metadata
- Download URL: meshapi_code-0.2.1.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2417887a8fc8ab8bc8779599b548de7f2ff806c6953fb9b61fb4767228d11712
|
|
| MD5 |
54aaf3e0cf53c460494e9fb308b4c166
|
|
| BLAKE2b-256 |
97d9bd1b2573e386fd25154b58a5b9dd78c74a9556e47a17dda79e0ade12aa24
|
Provenance
The following attestation bundles were made for meshapi_code-0.2.1.tar.gz:
Publisher:
publish.yml on aifiesta/meshapi-code
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshapi_code-0.2.1.tar.gz -
Subject digest:
2417887a8fc8ab8bc8779599b548de7f2ff806c6953fb9b61fb4767228d11712 - Sigstore transparency entry: 1452806827
- Sigstore integration time:
-
Permalink:
aifiesta/meshapi-code@70480fe1d9b944c68ad503d54ea388ed8cdb114c -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/aifiesta
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@70480fe1d9b944c68ad503d54ea388ed8cdb114c -
Trigger Event:
push
-
Statement type:
File details
Details for the file meshapi_code-0.2.1-py3-none-any.whl.
File metadata
- Download URL: meshapi_code-0.2.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aa3faa922253219d61edb9d1a934a0283b6e28f068f1a4c3daff07ce6a3b188
|
|
| MD5 |
d164a82c1d1e0bd581d220c8140a1636
|
|
| BLAKE2b-256 |
5aab7b17e3558903162d53d18366ef8c26417c6732baecf0aa3f429ed65ee901
|
Provenance
The following attestation bundles were made for meshapi_code-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on aifiesta/meshapi-code
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshapi_code-0.2.1-py3-none-any.whl -
Subject digest:
3aa3faa922253219d61edb9d1a934a0283b6e28f068f1a4c3daff07ce6a3b188 - Sigstore transparency entry: 1452806944
- Sigstore integration time:
-
Permalink:
aifiesta/meshapi-code@70480fe1d9b944c68ad503d54ea388ed8cdb114c -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/aifiesta
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@70480fe1d9b944c68ad503d54ea388ed8cdb114c -
Trigger Event:
push
-
Statement type: