Skip to content

CobaltOptions

Options for the Cobalt constructor.

DANGER

It's highly recommended that you save your API key (and maybe your instance URL) somewhere private. We are not responsible if your API key gets compromised.

instance

Indicates the API Instance URL.

WARNING

Hosted API instances (such as api.cobalt.tools) use bot protection and are not intended to be used in other projects without explicit permission. If you want to access the Cobalt API reliably, you should host your own instance or ask an instance owner for access.

Type: string

Example: 'https://api.cobalt.tools/'

auth

An API instance may be configured to require you to authenticate yourself. Check the Cobalt API Docs to learn more about this.

INFO

Internally sets an Authorization request header. Read more on Headers.

Type:

NameType
scheme'Api-Key' or 'Bearer'
tokenstring

Example:

ts
{
    scheme: 'Api-Key',
    token: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
}

headers optional

Modify the request headers. Read more on Headers.

Type: HeadersInit

Example:

ts
{
    'User-Agent': 'Example-Bot',
    'Cookie': 'id=examplebot'
}