class documentation

Bearer that supplies a static token to authenticators.

The bearer may be constructed with either a Token instance or a raw token string. When a string is provided it is converted into a Token. Empty token strings are rejected.

Example

Construct a bearer and use it to initialize the SDK:

from nebius.sdk import SDK
from nebius.aio.token.static import Bearer

sdk = SDK(credentials=Bearer("my-static-token"))
Parameters
tokenToken instance or raw token string.
Raises
SDKErrorWhen an empty token string is provided.
Method __init__ Initialize the static token bearer.
Method receiver Return a Receiver that yields the configured token.
Instance Variable _tok Undocumented

Inherited from Bearer:

Async Method close Close the bearer and any wrapped resources.
Property name Optional human-readable name for the bearer.
Property wrapped Return the wrapped bearer or None if not wrapping.
def __init__(self, token: Token | str): (source)

Initialize the static token bearer.

def receiver(self) -> Receiver: (source)

Return a Receiver that yields the configured token.

Returns
ReceiverA Receiver bound to the static token.

Undocumented