Registry / payments / cybrid-api-bank-python

cybrid-api-bank-python

JSON →
library0.129.389pypypi✓ verified 85d ago

The `cybrid-api-bank-python` library provides a Python client for interacting with the Cybrid Bank API. It enables developers to build and launch white-label crypto products and services, managing resources across banks, customers, accounts, and more. This package is automatically generated from the Cybrid OpenAPI specification. The current version is `0.128.106`, and it appears to be actively maintained with frequent releases, often on a daily basis.

pip install cybrid-api-bank-python
INSTALL
IMPORT
SIG · CYBRID-API-BANK-PY
C
cybrid-api-bank-python
paymentspythonv0.129.389
Install
3.2s avg
Import
362ms
Disk
31MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.129.389 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.378s · 33MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.2s · import 0.345s · 34MB
31MB installed
● package 31MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Configuration
from cybrid_api_bank.configuration import Configuration
Used for configuring the API client, especially authentication.
ApiClient
from cybrid_api_bank.api_client import ApiClient
The core client for making API requests.
BanksApi
from cybrid_api_bank.api.banks_api import BanksApi
One of the generated API classes for interacting with bank-related endpoints. Other API classes (e.g., AccountsApi, CustomersApi) follow a similar pattern.
AccountsApi
from cybrid_api_bank.api.accounts_api import AccountsApi
One of the generated API classes for interacting with account-related endpoints.
exceptions
from cybrid_api_bank import exceptions
Access to specific API exceptions for error handling.

This quickstart demonstrates how to configure the Cybrid Bank API client using a Bearer Token and then make a simple call to list accounts. It emphasizes the importance of secure credential management via environment variables. In a production environment, you would first obtain an access token from the Cybrid Identity Provider using your Client ID and Client Secret.

import os import cybrid_api_bank from cybrid_api_bank.configuration import Configuration from cybrid_api_bank.api_client import ApiClient from cybrid_api_bank.api.accounts_api import AccountsApi # --- Configuration and Authentication --- # It is strongly recommended to store Client ID and Secret in environment variables. # Generate these credentials from the Cybrid Sandbox or dashboard. # The access token can be generated using the Client ID and Client Secret via an OAuth 2.0 Client Credentials Grant flow. # For a quick start, you might manually obtain a Bearer Token and use it directly. # Replace with your actual Bearer Token or logic to fetch it. # In a real application, you'd make an OAuth request to Cybrid's Identity Provider # to exchange CLIENT_ID and CLIENT_SECRET for an ACCESS_TOKEN. # Example: curl -X POST https://id.sandbox.cybrid.app/oauth/token -d '{"grant_type": "client_credentials", "client_id": "<Your Client ID>", "client_secret": "<Your Secret>", "scope": "accounts:read"}' ACCESS_TOKEN = os.environ.get('CYBRID_BANK_ACCESS_TOKEN', 'YOUR_CYBRID_BANK_ACCESS_TOKEN') # Configure API key authorization: BearerAuth configuration = Configuration( access_token = ACCESS_TOKEN, host = "https://bank.sandbox.cybrid.app" # Or https://bank.production.cybrid.app for production ) # Create an instance of the API client with ApiClient(configuration) as api_client: # Create an instance of the AccountsApi accounts_api_instance = AccountsApi(api_client) try: # List accounts # Optional parameters can be passed as keyword arguments api_response = accounts_api_instance.list_accounts(limit=10) print("Successfully listed accounts:") for account in api_response.data: print(f" Account GUID: {account.guid}, Asset: {account.asset}, Balance: {account.platform_balance}") except cybrid_api_bank.exceptions.ApiException as e: print(f"Exception when calling AccountsApi->list_accounts: {e}") except Exception as e: print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingThe Cybrid API, and by extension its generated clients, may undergo breaking changes. While Cybrid aims for a safe evolution of its API, changes in OpenAPI definitions can lead to breaking changes in downstream clients. Developers should subscribe to Cybrid's changelog for advance notice.
fix
Monitor Cybrid's official API documentation and changelog for announcements. Regenerate the client if using custom generation, or update the library and adapt code as necessary.
affects: All versions, due to upstream API evolution
gotchaAPI credentials (Client ID and Secret) should never be embedded directly in code or committed to a source code repository. They should be stored securely, preferably in environment variables or a secrets management tool.
fix
Store `CLIENT_ID` and `CLIENT_SECRET` as environment variables (e.g., `CYBRID_CLIENT_ID`, `CYBRID_CLIENT_SECRET`) and retrieve them using `os.environ.get()` at runtime. Implement an OAuth client credentials flow to obtain time-limited Bearer Tokens.
affects: All versions
gotchaUsing a broadly scoped 'Bank token' for customer-specific operations can lead to security vulnerabilities. API requests for a specific customer should use a customer-scoped access token.
fix
Generate customer-scoped access tokens via the Identity API's `POST /api/customer_tokens` endpoint for all customer-based API requests. This adheres to the principle of least privilege.
affects: All versions
gotchaAccess tokens have a limited lifetime (e.g., 30 minutes in production, 8 hours in sandbox). API calls with expired tokens will result in 401 Unauthorized errors.
fix
Implement robust token expiration handling. This includes detecting `401 Unauthorized` responses, refreshing the access token (using your Client ID/Secret or refresh token if applicable), and retrying the failed API request with the new token.
affects: All versions
Errors
Common errors & fixes
cybrid_api_bank.exceptions.ApiException: (401) Reason: Unauthorized HTTP response body: {'message': 'Unauthorized', 'message_code': 'unauthorized'}
The provided access token is missing, invalid, or expired.
fix
Ensure `CYBRID_BANK_ACCESS_TOKEN` environment variable is correctly set with a valid, non-expired Bearer Token. Implement token refresh logic in production applications to automatically renew tokens before or upon expiration.
AttributeError: module 'cybrid_api_bank' has no attribute 'api'
Incorrect import path for API classes. The API classes are nested within the `api` submodule.
fix
Adjust import statements to correctly reference the `api` submodule. For example, use `from cybrid_api_bank.api.accounts_api import AccountsApi` instead of `from cybrid_api_bank import AccountsApi`.
cybrid_api_bank.exceptions.ApiException: (403) Reason: Forbidden HTTP response body: {'message': 'Forbidden', 'message_code': 'invalid_scope'}
The access token used does not have the necessary scopes to perform the requested operation.
fix
Review the required scopes for the API endpoint you are calling (refer to Cybrid API documentation). Ensure that when you generate your access token, you request all the necessary scopes (e.g., `accounts:read` for listing accounts, `accounts:execute` for creating accounts).
Upgrade
Version history
0.129.389latest on PyPI · released Jun 14, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
34
Perplexity
1
OpenAI (training)
1
Resources