Ora
All guides All guides

Getting started

Your first decision in the Playground Call the API from your code Save, share and reuse queries

Financial decisions

Decide on a stock with just its symbol Read probabilities and choose thresholds

Automation

Send a Slack alert when a rule fires Send decisions to your own system Run a watchlist every day after the close

Production

Handle errors, rate limits and retries

Use cases

Tag financial news for trading signalsGuardrails for LLM appsSupport ticket triage and routingFilter retrieved passages before your LLM answersVerify claims and citations against a source

Guides / Production

Production · about 8 min

Handle errors, rate limits and retries

What each status means, which ones to retry, and a client that does it for you.

  1. Know which errors to retry

    StatusMeaningDo
    400 / 422The request is malformed or invalid; detail lists every problem with its locationFix the request; don't retry
    401Missing or invalid keyCheck JEV_API_KEY
    402No balance leftAdd credits (Settings → Billing)
    429Rate limitedWait Retry-After seconds, retry
    503Temporarily unavailableRetry with backoff
  2. Retry with backoff

    import os, time, requests
    
    URL = "https://oramodel.com/v1/systemone"
    HEADERS = {"Authorization": f"Bearer {os.environ['JEV_API_KEY']}"}
    
    def decide(payload, attempts=4):
        for i in range(attempts):
            r = requests.post(URL, headers=HEADERS, json=payload, timeout=30)
            if r.status_code == 200:
                return r.json()
            if r.status_code in (429, 503) and i < attempts - 1:
                time.sleep(float(r.headers.get("Retry-After", 2 ** i)))
                continue
            raise RuntimeError(f"{r.status_code}: {r.json().get('detail')}")
  3. Stay under your limits

    Limits are per organization (requests and input tokens per second), shared by all keys and the Playground. Every response carries x-ratelimit-limit-requests and x-ratelimit-limit-tokens. Put several questions in one request instead of one request per question.

  4. Log what you need

    Log model (the exact version) and usage.input_tokens with each decision, so you can trace it and reconcile spend under Usage.

What's next

Create an account Open the Playground Everything here also lives in the console, next to your keys and usage.