All URIs are relative to https://api.mixpeek.com
| Method | HTTP request | Description |
|---|---|---|
| confirm_payment_method_organizations_billing | POST /v1/organizations/billing/confirm-payment-method | Confirm Payment Method |
| disable_auto_billing_organizations | POST /v1/organizations/billing/disable-auto-billing | Disable Auto Billing |
| enable_auto_billing_organizations | POST /v1/organizations/billing/enable-auto-billing | Enable Auto Billing |
| generate_invoice_now_organizations_billing | POST /v1/organizations/billing/generate-invoice | Generate Invoice Now |
| get_credit_balance_organizations_billing | GET /v1/organizations/billing/balance | Get Credit Balance |
| get_current_usage_organizations_billing | GET /v1/organizations/billing/usage/current | Get Current Usage |
| get_payment_method_organizations_billing | GET /v1/organizations/billing/payment-method | Get Payment Method |
| get_spending_caps_organizations_billing | GET /v1/organizations/billing/spending-caps | Get Spending Caps |
| get_usage_breakdown_organizations_billing | GET /v1/organizations/billing/usage/breakdown | Get Usage Breakdown |
| list_invoices_organizations_billing | GET /v1/organizations/billing/invoices | List Invoices |
| setup_payment_method_organizations_billing | POST /v1/organizations/billing/setup-payment-method | Setup Payment Method |
| update_spending_caps_organizations_billing | POST /v1/organizations/billing/spending-caps | Update Spending Caps |
ConfirmPaymentMethodResponse confirm_payment_method_organizations_billing(confirm_payment_method_request, authorization=authorization)
Confirm Payment Method
Confirm payment method after frontend collects it.
After Stripe Elements confirms the SetupIntent, call this endpoint to attach the payment method to the customer and enable auto-billing.
Requirements:
- Admin permission
- Must have called setup-payment-method first
Example:
# After Stripe Elements confirms setup
response = await client.post(
"/v1/organizations/billing/confirm-payment-method",
json={"payment_method_id": "pm_1ABC2DEF3GHI"}
)import mixpeek
from mixpeek.models.confirm_payment_method_request import ConfirmPaymentMethodRequest
from mixpeek.models.confirm_payment_method_response import ConfirmPaymentMethodResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
confirm_payment_method_request = mixpeek.ConfirmPaymentMethodRequest() # ConfirmPaymentMethodRequest |
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Confirm Payment Method
api_response = api_instance.confirm_payment_method_organizations_billing(confirm_payment_method_request, authorization=authorization)
print("The response of OrganizationBillingApi->confirm_payment_method_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->confirm_payment_method_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| confirm_payment_method_request | ConfirmPaymentMethodRequest | ||
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AutoBillingToggleResponse disable_auto_billing_organizations(authorization=authorization)
Disable Auto Billing
Disable automatic monthly billing.
Disables automatic billing but keeps payment method saved. Organization can re-enable later or pay invoices manually.
Requirements:
- Admin permission
Example:
response = await client.post("/v1/organizations/billing/disable-auto-billing")import mixpeek
from mixpeek.models.auto_billing_toggle_response import AutoBillingToggleResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Disable Auto Billing
api_response = api_instance.disable_auto_billing_organizations(authorization=authorization)
print("The response of OrganizationBillingApi->disable_auto_billing_organizations:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->disable_auto_billing_organizations: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AutoBillingToggleResponse enable_auto_billing_organizations(authorization=authorization)
Enable Auto Billing
Enable automatic monthly billing.
Re-enables automatic billing if it was previously disabled. Payment method must already be saved.
Requirements:
- Admin permission
- Must have payment method saved
Example:
response = await client.post("/v1/organizations/billing/enable-auto-billing")import mixpeek
from mixpeek.models.auto_billing_toggle_response import AutoBillingToggleResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Enable Auto Billing
api_response = api_instance.enable_auto_billing_organizations(authorization=authorization)
print("The response of OrganizationBillingApi->enable_auto_billing_organizations:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->enable_auto_billing_organizations: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Dict[str, object] generate_invoice_now_organizations_billing(authorization=authorization, body_generate_invoice_now_v1_organizations_billing_generate_invoice_post=body_generate_invoice_now_v1_organizations_billing_generate_invoice_post)
Generate Invoice Now
Manually trigger invoice generation for this organization.
Useful for testing the billing flow or generating retroactive invoices. Requires ADMIN permission.
Example:
# Dry run
response = await client.post(
"/v1/organizations/billing/generate-invoice",
json={"dry_run": true}
)
# Actually generate
response = await client.post(
"/v1/organizations/billing/generate-invoice",
json={"billing_month": "2026-01"}
)import mixpeek
from mixpeek.models.body_generate_invoice_now_v1_organizations_billing_generate_invoice_post import BodyGenerateInvoiceNowV1OrganizationsBillingGenerateInvoicePost
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
body_generate_invoice_now_v1_organizations_billing_generate_invoice_post = mixpeek.BodyGenerateInvoiceNowV1OrganizationsBillingGenerateInvoicePost() # BodyGenerateInvoiceNowV1OrganizationsBillingGenerateInvoicePost | (optional)
try:
# Generate Invoice Now
api_response = api_instance.generate_invoice_now_organizations_billing(authorization=authorization, body_generate_invoice_now_v1_organizations_billing_generate_invoice_post=body_generate_invoice_now_v1_organizations_billing_generate_invoice_post)
print("The response of OrganizationBillingApi->generate_invoice_now_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->generate_invoice_now_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
| body_generate_invoice_now_v1_organizations_billing_generate_invoice_post | BodyGenerateInvoiceNowV1OrganizationsBillingGenerateInvoicePost | [optional] |
Dict[str, object]
No authorization required
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreditBalanceResponse get_credit_balance_organizations_billing(authorization=authorization)
Get Credit Balance
Get current credit balance and tier information.
Returns the organization's credit balance, current tier, and usage statistics. Useful for displaying billing status in dashboards.
Requirements:
- Read permission
Example:
response = await client.get("/v1/organizations/billing/balance")
print(f"Balance: {response['credit_balance']} credits")
print(f"Tier: {response['account_tier']}")import mixpeek
from mixpeek.models.credit_balance_response import CreditBalanceResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Get Credit Balance
api_response = api_instance.get_credit_balance_organizations_billing(authorization=authorization)
print("The response of OrganizationBillingApi->get_credit_balance_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->get_credit_balance_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CurrentUsageResponse get_current_usage_organizations_billing(authorization=authorization)
Get Current Usage
Get current month usage.
Returns credit consumption for the current billing period, estimated cost, and next invoice date.
Requirements:
- Read permission
Example:
response = await client.get("/v1/organizations/billing/usage/current")
print(f"Usage: {response['current_month_usage']} credits")
print(f"Estimated cost: ${response['estimated_cost_usd']}")import mixpeek
from mixpeek.models.current_usage_response import CurrentUsageResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Get Current Usage
api_response = api_instance.get_current_usage_organizations_billing(authorization=authorization)
print("The response of OrganizationBillingApi->get_current_usage_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->get_current_usage_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetPaymentMethodResponse get_payment_method_organizations_billing(authorization=authorization)
Get Payment Method
Get current payment method.
Returns the saved payment method details (last 4 digits, brand) and auto-billing status.
Requirements:
- Read permission
Example:
response = await client.get("/v1/organizations/billing/payment-method")
if response["has_payment_method"]:
print(f"Card: {response['payment_method']['card_brand']} ****{response['payment_method']['card_last4']}")import mixpeek
from mixpeek.models.get_payment_method_response import GetPaymentMethodResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Get Payment Method
api_response = api_instance.get_payment_method_organizations_billing(authorization=authorization)
print("The response of OrganizationBillingApi->get_payment_method_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->get_payment_method_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SpendingCapsResponse get_spending_caps_organizations_billing(authorization=authorization)
Get Spending Caps
Get current spending cap configuration.
Returns spending cap settings including budget limits, alert thresholds, and current spending status.
Requirements:
- Read permission
Example:
response = await client.get("/v1/organizations/billing/spending-caps")
print(f"Monthly budget: ${response['monthly_spending_budget_usd']}")
print(f"Hard cap enabled: {response['hard_cap_enabled']}")
print(f"Current spending: ${response['current_spending_usd']}")import mixpeek
from mixpeek.models.spending_caps_response import SpendingCapsResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Get Spending Caps
api_response = api_instance.get_spending_caps_organizations_billing(authorization=authorization)
print("The response of OrganizationBillingApi->get_spending_caps_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->get_spending_caps_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UsageBreakdownResponse get_usage_breakdown_organizations_billing(billing_month=billing_month, authorization=authorization)
Get Usage Breakdown
Get detailed usage breakdown.
Returns usage breakdown by operation type and extractor for the specified billing period.
Query Parameters:
billing_month: Month to query (YYYY-MM format, defaults to current)
Requirements:
- Read permission
Example:
# Current month
response = await client.get("/v1/organizations/billing/usage/breakdown")
# Specific month
response = await client.get(
"/v1/organizations/billing/usage/breakdown",
params={"billing_month": "2025-11"}
)import mixpeek
from mixpeek.models.usage_breakdown_response import UsageBreakdownResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
billing_month = 'billing_month_example' # str | Billing month in YYYY-MM format (defaults to current month) (optional)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Get Usage Breakdown
api_response = api_instance.get_usage_breakdown_organizations_billing(billing_month=billing_month, authorization=authorization)
print("The response of OrganizationBillingApi->get_usage_breakdown_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->get_usage_breakdown_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| billing_month | str | Billing month in YYYY-MM format (defaults to current month) | [optional] |
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InvoiceListResponse list_invoices_organizations_billing(limit=limit, authorization=authorization)
List Invoices
List monthly invoices.
Returns paginated list of monthly invoices with links to Stripe-hosted invoice pages.
Query Parameters:
limit: Number of invoices (1-100, default 10)
Requirements:
- Read permission
Example:
response = await client.get("/v1/organizations/billing/invoices?limit=10")
for invoice in response["invoices"]:
print(f"{invoice['billing_month']}: ${invoice['amount_paid']/100}")import mixpeek
from mixpeek.models.invoice_list_response import InvoiceListResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
limit = 10 # int | Number of invoices to return (optional) (default to 10)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# List Invoices
api_response = api_instance.list_invoices_organizations_billing(limit=limit, authorization=authorization)
print("The response of OrganizationBillingApi->list_invoices_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->list_invoices_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Number of invoices to return | [optional] [default to 10] |
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SetupPaymentMethodResponse setup_payment_method_organizations_billing(authorization=authorization)
Setup Payment Method
Initialize payment method setup flow.
Creates a Stripe SetupIntent for collecting payment method without charging. The client_secret should be used with Stripe Elements on the frontend.
Flow:
- Frontend calls this endpoint
- Backend creates Stripe Customer (if needed) and SetupIntent
- Frontend uses client_secret with Stripe Elements
- User enters card details
- Frontend calls confirm-payment-method endpoint
Requirements:
- Admin permission (only org admins can set up payment methods)
Example:
response = await client.post("/v1/organizations/billing/setup-payment-method")
client_secret = response["client_secret"]
# Use client_secret with Stripe Elementsimport mixpeek
from mixpeek.models.setup_payment_method_response import SetupPaymentMethodResponse
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Setup Payment Method
api_response = api_instance.setup_payment_method_organizations_billing(authorization=authorization)
print("The response of OrganizationBillingApi->setup_payment_method_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->setup_payment_method_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SpendingCapsResponse update_spending_caps_organizations_billing(update_spending_caps_request, authorization=authorization)
Update Spending Caps
Update spending cap configuration.
Configure spending limits and alert thresholds to control costs.
Features:
- Soft Limit (Budget): Triggers alerts but doesn't block API access
- Hard Cap: Blocks API access when reached (requires explicit enable)
- Alert Thresholds: Customize when to receive spending notifications
Requirements:
- Admin permission
- Only applies to organizations with auto-billing enabled
Example:
# Set $100 budget with alerts at 75% and 100%
response = await client.post(
"/v1/organizations/billing/spending-caps",
json={
"monthly_spending_budget": 10000, # $100 in cents
"spending_alert_thresholds": [75, 100],
"spending_alerts_enabled": True,
}
)
# Enable hard cap at $500
response = await client.post(
"/v1/organizations/billing/spending-caps",
json={
"hard_spending_cap": 50000, # $500 in cents
"hard_cap_enabled": True,
}
)
# Disable all spending limits
response = await client.post(
"/v1/organizations/billing/spending-caps",
json={
"monthly_spending_budget": None,
"hard_spending_cap": None,
"hard_cap_enabled": False,
}
)import mixpeek
from mixpeek.models.spending_caps_response import SpendingCapsResponse
from mixpeek.models.update_spending_caps_request import UpdateSpendingCapsRequest
from mixpeek.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mixpeek.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mixpeek.Configuration(
host = "https://api.mixpeek.com"
)
# Enter a context with an instance of the API client
with mixpeek.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mixpeek.OrganizationBillingApi(api_client)
update_spending_caps_request = mixpeek.UpdateSpendingCapsRequest() # UpdateSpendingCapsRequest |
authorization = 'authorization_example' # str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. (optional)
try:
# Update Spending Caps
api_response = api_instance.update_spending_caps_organizations_billing(update_spending_caps_request, authorization=authorization)
print("The response of OrganizationBillingApi->update_spending_caps_organizations_billing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OrganizationBillingApi->update_spending_caps_organizations_billing: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| update_spending_caps_request | UpdateSpendingCapsRequest | ||
| authorization | str | REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings. | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]