Leap Laboratories Account API
The account API from Leap Laboratories — 4 operation(s) for account.
The account API from Leap Laboratories — 4 operation(s) for account.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/leap-labs-com:leap-labs-com-account-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Disco Account API
description: 'Disco finds novel, statistically validated patterns in tabular data that correlation analysis, LLMs, and hypothesis-driven approaches miss. Each pattern is validated on hold-out data with FDR-corrected p-values and checked against academic literature with citations.
## Agent workflow
**Step 1 — Get an API key** (once):
- `POST /api/signup` with `{"email": "..."}` → sends a 6-digit code
- `POST /api/signup/verify` with `{"email": "...", "code": "..."}` → returns `{"key": "disco_..."}`
- Use this key as `Authorization: Bearer disco_...` for all subsequent requests
**Step 2 — Estimate cost** (optional but recommended):
- `POST /api/estimate` with file size, column count, depth, visibility
- Returns credit cost and time estimate
**Step 3 — Upload data** (pick one):
- *From URL:* `POST /api/data/upload/from-url` with `{"url": "https://..."}` → returns `file` and `columns`
- *Direct (base64):* `POST /api/data/upload/direct` with `{"fileName": "data.csv", "content": ""}` → returns `file` and `columns`. Max 50MB.
- *Presign flow (for large files):* `POST /api/data/upload/presign` → PUT file to `uploadUrl` → `POST /api/data/upload/finalize`
**Step 4 — Run analysis:**
- `POST /api/run-analysis` with `file`, `columns`, and `targetColumn` from step 3 → returns `{"run_id": "..."}`
**Step 5 — Poll for results:**
- `GET /api/runs/{run_id}/results` — poll every 10s until `status` is `"completed"` (time varies with dataset size and depth)
- Response includes `patterns[]` with conditions, p-values, effect sizes, novelty scores, and citations
## Billing
Public runs are free. If the user needs more credits or a paid plan, send them to https://disco.leap-labs.com/account to upgrade.
## Authentication
`disco_` API keys via `Authorization: Bearer disco_...` header. Get a key via signup or at https://disco.leap-labs.com/developers.
## SDK
`pip install discovery-engine-api` — Full docs'
version: 1.0.0
servers:
- url: https://disco.leap-labs.com
tags:
- name: Account
paths:
/api/account:
get:
tags:
- Account
summary: Get account status
description: Returns current plan, available credits (subscription + purchased), payment method status, and Stripe identifiers. Use this to check credit balance before running a private analysis.
operationId: get_account
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AccountResponse'
/api/account/credits/purchase:
post:
tags:
- Account
summary: Purchase credit packs
description: Purchase Disco credits using a stored payment method. Credits cost $0.10 each, sold in packs of 100 ($10/pack). Requires a payment method on file (attach one via `POST /api/account/payment-method`). Returns 402 if no payment method is attached.
operationId: purchase_credits
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PurchaseCreditsRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PurchaseCreditsResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/account/subscribe:
post:
tags:
- Account
summary: Subscribe to or change plan
description: 'Subscribe to or change your Disco plan. Available plans: Explorer (free, 10 credits/mo), Researcher ($49, 500 credits/mo), Team ($199, 2000 credits/mo). Paid plans require a payment method on file. Credits roll over on paid plans. Use `GET /api/plans` to see all plan details.'
operationId: subscribe
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SubscribeRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SubscribeResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/account/payment-method:
post:
tags:
- Account
summary: Attach a payment method
description: Attach a Stripe payment method to your account. The payment method must be tokenized via Stripe's API first (using the `stripe_publishable_key` from `POST /api/api-keys` or `GET /api/account`) — card details never touch Disco. Required before purchasing credits or subscribing to a paid plan.
operationId: add_payment_method
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AttachPaymentMethodRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AttachPaymentMethodResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
AccountCredits:
properties:
subscription:
type: integer
title: Subscription
description: Credits from subscription allowance
purchased:
type: integer
title: Purchased
description: Credits from pack purchases
total:
type: integer
title: Total
description: Total available credits
type: object
required:
- subscription
- purchased
- total
title: AccountCredits
AccountPaymentMethod:
properties:
on_file:
type: boolean
title: On File
description: Whether a payment method is attached
card_last4:
anyOf:
- type: string
- type: 'null'
title: Card Last4
description: Last 4 digits of card
card_brand:
anyOf:
- type: string
- type: 'null'
title: Card Brand
description: Card brand (visa, mastercard, etc.)
type: object
required:
- on_file
- card_last4
- card_brand
title: AccountPaymentMethod
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
AccountPlan:
properties:
tier:
type: string
title: Tier
description: Current plan tier ID
name:
type: string
title: Name
description: Human-readable plan name
monthly_credits:
anyOf:
- type: integer
- type: 'null'
title: Monthly Credits
description: Credits included per month
price_usd:
anyOf:
- type: number
- type: 'null'
title: Price Usd
description: Monthly price in USD
type: object
required:
- tier
- name
- monthly_credits
- price_usd
title: AccountPlan
AccountResponse:
properties:
user_id:
type: string
title: User Id
description: User UUID
email:
anyOf:
- type: string
- type: 'null'
title: Email
description: User email address
organization:
$ref: '#/components/schemas/AccountOrganization'
plan:
$ref: '#/components/schemas/AccountPlan'
credits:
$ref: '#/components/schemas/AccountCredits'
payment_method:
$ref: '#/components/schemas/AccountPaymentMethod'
stripe_publishable_key:
anyOf:
- type: string
- type: 'null'
title: Stripe Publishable Key
description: Stripe publishable key for client-side payment method tokenization
stripe_customer_id:
anyOf:
- type: string
- type: 'null'
title: Stripe Customer Id
description: Stripe customer ID
type: object
required:
- user_id
- email
- organization
- plan
- credits
- payment_method
- stripe_publishable_key
- stripe_customer_id
title: AccountResponse
AttachPaymentMethodRequest:
properties:
payment_method_id:
type: string
title: Payment Method Id
description: Stripe payment method token (pm_...)
type: object
required:
- payment_method_id
title: AttachPaymentMethodRequest
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError
PurchaseCreditsRequest:
properties:
packs:
type: integer
maximum: 50
minimum: 1
title: Packs
description: Number of 100-credit packs to purchase
default: 1
type: object
title: PurchaseCreditsRequest
SubscribeRequest:
properties:
plan:
type: string
pattern: ^(free_tier|tier_1|tier_2)$
title: Plan
description: Plan tier ID
type: object
required:
- plan
title: SubscribeRequest
AttachPaymentMethodResponse:
properties:
payment_method_attached:
type: boolean
title: Payment Method Attached
description: Whether attachment succeeded
card_last4:
anyOf:
- type: string
- type: 'null'
title: Card Last4
description: Last 4 digits of the attached card
card_brand:
anyOf:
- type: string
- type: 'null'
title: Card Brand
description: Card brand (visa, mastercard, etc.)
type: object
required:
- payment_method_attached
- card_last4
- card_brand
title: AttachPaymentMethodResponse
SubscribeResponse:
properties:
plan:
type: string
title: Plan
description: New plan tier ID
name:
type: string
title: Name
description: Human-readable plan name
monthly_credits:
type: integer
title: Monthly Credits
description: Credits included per month on new plan
price_usd:
anyOf:
- type: number
- type: 'null'
title: Price Usd
description: Monthly price in USD
type: object
required:
- plan
- name
- monthly_credits
- price_usd
title: SubscribeResponse
PurchaseCreditsResponse:
properties:
purchased_credits:
type: integer
title: Purchased Credits
description: Credits purchased in this transaction
total_credits:
type: integer
title: Total Credits
description: Total credits available after purchase
charge_amount_usd:
type: number
title: Charge Amount Usd
description: Amount charged in USD
stripe_payment_id:
type: string
title: Stripe Payment Id
description: Stripe payment intent ID
type: object
required:
- purchased_credits
- total_credits
- charge_amount_usd
- stripe_payment_id
title: PurchaseCreditsResponse
AccountOrganization:
properties:
id:
type: string
title: Id
description: Organization UUID
name:
type: string
title: Name
description: Organization name
type: object
required:
- id
- name
title: AccountOrganization