# Bay Run — retrieval first, honest model lab on top # Start with OpenAI-compatible embeddings; use labeled examples only when you need evidence. # FREE during launch: everything below costs $0.00. No card, no signup. # Ordinary free calls: 60/min, 1500/day per IP. Bake-offs: 15/day per principal. # Canonical: https://run.huggingbay.xyz/quickstart (JSON variant: send Accept: application/json) # A bake-off may return no_specialists, a weak field, or a strong receipted field. # Only a strong field offers a best-model badge/author claim and winner-bound next call. # Data policy (read before sending data): https://run.huggingbay.xyz/.well-known/data-policy.json # Browser playground: https://run.huggingbay.xyz/playground — route, stream, verify, and bake off in three clicks. ## Step 0 — every demo token gets private session memory immediately SESSION_TOKEN=$(curl -s -X POST https://run.huggingbay.xyz/oauth/token -H 'Content-Type: application/x-www-form-urlencoded' --data 'grant_type=urn:bay-run:grant-type:demo&scope=mcp:demo&resource=https://run.huggingbay.xyz' | python3 -c 'import sys,json;print(json.load(sys.stdin)["access_token"])') curl -s -X POST https://run.huggingbay.xyz/v1/memory -H "Authorization: Bearer $SESSION_TOKEN" -H 'Content-Type: application/json' -d '{"namespace":"quickstart","key":"chosen_path","value":{"route":"solve_task"}}' # The same token can recall it. Session memory is capped at 50 rows / 4KB values # and expires with the token; register client_secret_post or mint bay_live_ to upgrade. ## Step 1 — retrieval first: OpenAI-compatible embeddings on the warm lane curl -s -X POST https://run.huggingbay.xyz/v1/embeddings -H "Authorization: Bearer $SESSION_TOKEN" -H 'Content-Type: application/json' -d '{"model":"BAAI/bge-small-en-v1.5","input":["hello retrieval"]}' # -> OpenAI-shaped vectors plus a signed provenance receipt ## Step 1b — optional one-call task path: route, execute, and return receipt curl -s -X POST https://run.huggingbay.xyz/v1/solve -H "Authorization: Bearer $SESSION_TOKEN" -H 'Content-Type: application/json' -d '{"task_description":"Classify customer feedback by sentiment","input":"The checkout was fast and helpful."}' # -> result, routed_model, receipt, and next_call suggestions (including bakeoff) ## Step 2 — optional anonymous lab: detect one family and score its warm intersection # To request a public HF challenger, add "challenger_model":"your-hf-org/your-model". # It is scored only if already resident and family-compatible; otherwise it is deferred. curl -s https://run.huggingbay.xyz/v1/bakeoff \ -H 'Content-Type: application/json' \ -d '{"task_description":"Classify customer feedback by sentiment","examples":[{"input":"Setup took two minutes and works perfectly.","expected":"positive"},{"input":"The checkout is broken and I want a refund.","expected":"negative"},{"input":"I love how fast the search feels.","expected":"positive"}]}' # -> no_specialists (underfilled), or a scorecard with weak/field_strength/receipt/public_url. # A weak field has no best-model title, badge, or author claim. Only when weak=false, # follow the authorized next_call and use the offered claim/badge fields. # Add "public":false to keep a bake-off off the public leaderboard. ## Step 2 — keep your history: mint a durable free key (no email/card/signup) BAY_RUN_KEY=$(curl -s -X POST https://run.huggingbay.xyz/v1/keys/free \ | python3 -c 'import sys,json;print(json.load(sys.stdin)["key"])') # Store the bay_live_ secret returned once; it is revocable and carries 500 tasks/day. ## Step 2b — durable task/token/latency and illustrative savings ledger curl -s https://run.huggingbay.xyz/v1/usage -H "Authorization: Bearer $BAY_RUN_KEY" # Key-only browser viewer (the page never logs or stores the key): https://run.huggingbay.xyz/usage ## OpenAI SDK (python) — same token; streaming chat against the same origin # from openai import OpenAI # client = OpenAI(base_url="https://run.huggingbay.xyz/v1", api_key=BAY_RUN_KEY) # stream = client.chat.completions.create(model="auto", stream=True, # messages=[{"role": "user", "content": "One sentence: why verify AI results?"}]) # for chunk in stream: print(chunk.choices[0].delta.content or "", end="") ## Step 3 — MCP: the same durable key works for run_bakeoff and quote -> run -> verify MTOK=$BAY_RUN_KEY # 3a. get_task_quote — free; the field is task_spec (not task); do NOT pass input here curl -s https://run.huggingbay.xyz/mcp/ -H "Authorization: Bearer $MTOK" \ -H 'Content-Type: application/json' -H 'Accept: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_task_quote","arguments":{"task_spec":{"task":"Classify short customer messages by sentiment","kind":"classification","input_schema":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},"output_schema":{"type":"object","properties":{"label":{"type":"string"}},"required":["label"]},"constraints":{"max_price_usd":"0.01"}}}}}' # -> result.structuredContent.quote_id # 3b. run_task — max_price_usd and idempotency_key are REQUIRED; paste your quote_id curl -s https://run.huggingbay.xyz/mcp/ -H "Authorization: Bearer $MTOK" \ -H 'Content-Type: application/json' -H 'Accept: application/json' \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"run_task","arguments":{"quote_id":"","input":{"text":"The checkout flow keeps rejecting my card."},"max_price_usd":0.01,"idempotency_key":"my-first-run-0001"}}}' # -> result.structuredContent.execution_id + .receipt (a signed execution receipt) # 3c. verify_result — paste execution_id and the receipt object from 3b curl -s https://run.huggingbay.xyz/mcp/ -H "Authorization: Bearer $MTOK" \ -H 'Content-Type: application/json' -H 'Accept: application/json' \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"verify_result","arguments":{"execution_id":"","receipt":}}}' # -> execution_authentic, receipt_valid, receipt_authentic, within_authorized_price: all true # More: https://run.huggingbay.xyz/llms.txt (short) | https://run.huggingbay.xyz/llms-full.txt (full reference) # Receipts do not claim answer truth or attested model-weight execution.