POST
/
v1
/
organizations
/
{organizationId}
/
provider-gateway
/
{provider}
/
sessions
TypeScript client
import { OctosparkClient } from '@octospark/sdk'

const client = new OctosparkClient({
  token: process.env.OCTOSPARK_TOKEN
})

const response = await client.providerGateway.openProviderSocket({
  organizationId: process.env.OCTOSPARK_ORGANIZATION_ID ?? "organizationId",
  provider: process.env.OCTOSPARK_PROVIDER ?? "provider",
  body: {},
})
{
  "sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "expiresAt": "<string>",
  "requestBytes": 123,
  "responseBytes": 123,
  "chargeDecimillicents": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

organizationId
string
required

Organization id (UUID). Discover ids via the list organizations endpoint or the agent context.

provider
enum<string>
required

AI vendor to access using this organisation connection: OpenRouter or ElevenLabs.

Available options:
openrouter,
elevenlabs

Body

application/json
path
string
required

a string at most 4096 character(s) long

Required string length: 1 - 4096
idempotencyKey
string
required

a string at most 128 character(s) long

Required string length: 8 - 128
query
object

Vendor query parameters; omit for none. Authentication overrides are rejected.

Response

Success

sessionId
string<uuid>
required

a Universally Unique Identifier

Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
status
enum<string>
required
Available options:
reserved,
queued,
preparing,
dispatched,
completed,
uncertain,
failed,
billing_hold
expiresAt
string
required
requestBytes
number
required
responseBytes
number
required
chargeDecimillicents
number
required