loopling.ai

API reference

Get the current account

Read your balance and the calling key’s spend and limit.

GET https://loopling.ai/v1/me

Authorization

Authorization

string · required

Your API key, as Bearer lpl_….

Response · 200

object

enum<string>

Object type.

Available options: account

user_id

string

Your account ID.

key

object

The key that made this call.

id

string

Key ID.

prefix

string

First 12 characters, as shown on API keys.

name

string

The name you gave it.

ink_limit

integer | null

The key’s spending limit, in cents. null when it has none.

ink_charged

integer

What this key has ever charged, in cents. Counts against ink_limit.

ink_reserved

integer

Held by this key’s running generations, in cents.

ink

object

Your account’s balance, in cents.

balance

integer

What you can spend: plan credit plus added credit.

period_grant_remaining

integer

Plan credit left this period. Spent first.

payg_balance

integer

Added credit. Never expires.

usd_payg_equivalent

number

balance in dollars.

Request

curl

curl https://loopling.ai/v1/me \
  -H "Authorization: Bearer $LOOPLING_API_KEY"

Node

const res = await fetch('https://loopling.ai/v1/me', {
  headers: { Authorization: `Bearer ${process.env.LOOPLING_API_KEY}` },
})
const me = await res.json() // { key: { name, ink_limit, ink_charged }, ink: { balance, … } }

Python

res = requests.get(
    "https://loopling.ai/v1/me",
    headers={"Authorization": f"Bearer {os.environ['LOOPLING_API_KEY']}"},
)
me = res.json()  # {"key": {"name": …, "ink_limit": …}, "ink": {"balance": …}}

Response

200

{
  "object": "account",
  "user_id": "7d3f2b9a-5c1e-4a8d-b6f0-2e9c4a1d8b57",
  "key": {
    "id": "4e1a9c27-8b3d-4f6e-a052-c7d9e1b3f468",
    "prefix": "lpl_a1b2c3d4",
    "name": "production renderer",
    "ink_limit": 5000,
    "ink_charged": 1290,
    "ink_reserved": 0
  },
  "ink": {
    "balance": 8716,
    "period_grant_remaining": 6200,
    "payg_balance": 2516,
    "usd_payg_equivalent": 87.16
  }
}

401

{
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "The API key is invalid, revoked or expired.",
    "request_id": "0b7c6f1e-2d4a-4e8b-9c3f-5a1d7e2b8c40"
  }
}

Use it to check a key before you submit, or to show a balance in your own tools.

Explore models

loopling.ai · hello@loopling.ai · for agents · community · pricing · API · terms · privacy