Users

You can ask ThrustLab who your API key belongs to and what that account is allowed to do. It is a quick way to check that your key works, and to find out whether your plan covers a flight simulation before you start one.

python
from thrustlab import Client

client = Client()
me = client.users.me()
print(me["email"], me["tier"])

client.users.me() is the only method here. It sends one request and returns your profile as a dictionary.

What you get back

What you get back
FieldWhat it holds
id, email, first_name, last_nameWho you are.
email_verifiedWhether you confirmed your email address. An unverified account can't run simulations.
tierYour plan, for example free or pro.
entitlementsWhat your plan lets you do.
concurrencyHow many runs you may have going at once, how many are active, and how many are queued.
unit_systemmetric or imperial, the setting you chose on the website.
default_project_idThe project that receives runs when you don't name one.

Check your plan before a flight simulation

Flight simulations need the Pro plan. The list entitlements["sim_types"] names the kinds of run your plan allows, bench for a test bench run and flight for a flight. A flight is flight:

python
if "flight" not in me["entitlements"]["sim_types"]:
    print("Your plan does not include flight simulations.")

If you submit one anyway, the call fails with an APIError whose http_status is 402. See Error handling. Plans and prices are on the pricing page.

What the key can see

The key acts as you. It sees your projects, your own parts and your runs, and nobody else's. Create and revoke keys on the API keys tab of your Account page. You can't do that from the library.