Skip to main content

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 cost in 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 cheapest lets 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

meshapi_code-0.2.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meshapi_code-0.2.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

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

Hashes for meshapi_code-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2417887a8fc8ab8bc8779599b548de7f2ff806c6953fb9b61fb4767228d11712
MD5 54aaf3e0cf53c460494e9fb308b4c166
BLAKE2b-256 97d9bd1b2573e386fd25154b58a5b9dd78c74a9556e47a17dda79e0ade12aa24

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshapi_code-0.2.1.tar.gz:

Publisher: publish.yml on aifiesta/meshapi-code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for meshapi_code-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3aa3faa922253219d61edb9d1a934a0283b6e28f068f1a4c3daff07ce6a3b188
MD5 d164a82c1d1e0bd581d220c8140a1636
BLAKE2b-256 5aab7b17e3558903162d53d18366ef8c26417c6732baecf0aa3f429ed65ee901

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshapi_code-0.2.1-py3-none-any.whl:

Publisher: publish.yml on aifiesta/meshapi-code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page