← Back to Home

Build on OPYNX

Integrate music streaming, event ticketing, and fan engagement into your app with the OPYNX API.

Authentication

All API requests require a Bearer token. Include your API key in the Authorization header.

curl -X GET https://api.opynx.dev/v1/tracks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Note: Keep your API key secret. Never expose it in client-side code. Use environment variables or a server-side proxy.

Tracks API

GET/v1/tracks

List all tracks. Supports pagination and filtering by genre, artist, or BPM.

Parameters: page, limit, genre, artist_id, bpm_min, bpm_max

curl https://api.opynx.dev/v1/tracks?genre=synthwave&limit=10 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response:

{
  "data": [
    {
      "id": "trk_abc123",
      "title": "Midnight Drive",
      "artist": { "id": "art_xyz", "name": "NeonWave" },
      "genre": "synthwave",
      "bpm": 120,
      "duration": 225,
      "stream_url": "https://cdn.opynx.dev/stream/trk_abc123",
      "created_at": "2025-12-01T00:00:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 10, "total": 142 }
}
POST/v1/tracks

Upload a new track. Requires Creator role. Send as multipart/form-data.

Parameters: title (required), genre, bpm, file (audio, required)

curl -X POST https://api.opynx.dev/v1/tracks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "title=Solar Flare" \
  -F "genre=electronic" \
  -F "bpm=128" \
  -F "file=@track.mp3"

Events API

GET/v1/events

List upcoming events. Filter by location, date range, or artist.

Parameters: page, limit, city, date_from, date_to, artist_id

curl https://api.opynx.dev/v1/events?city=los-angeles&limit=5 \
  -H "Authorization: Bearer YOUR_API_KEY"
POST/v1/events

Create a new event. Requires Creator or Facilitator role.

Parameters: title (required), venue, date (required), capacity, tiers (array of ticket tiers)

curl -X POST https://api.opynx.dev/v1/events \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Neon Nights Vol. 3",
    "venue": "The Echo, Los Angeles",
    "date": "2026-05-15T20:00:00Z",
    "capacity": 500,
    "tiers": [
      { "name": "General", "price": 25.00, "quantity": 400 },
      { "name": "VIP", "price": 75.00, "quantity": 100 }
    ]
  }'

Tickets API

GET/v1/tickets

List tickets for the authenticated user, or for a specific event.

Parameters: event_id, status (active, used, transferred)

curl https://api.opynx.dev/v1/tickets?event_id=evt_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"
POST/v1/tickets/purchase

Purchase a ticket for an event. Returns the ticket with QR code data.

curl -X POST https://api.opynx.dev/v1/tickets/purchase \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "event_id": "evt_abc123", "tier": "General", "quantity": 2 }'

Webhooks

Register webhook endpoints to receive real-time notifications for events like new streams, ticket purchases, and payouts.

POST/v1/webhooks

Register a new webhook endpoint.

curl -X POST https://api.opynx.dev/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://yourapp.com/webhooks/opynx",
    "events": ["track.streamed", "ticket.purchased", "payout.completed"]
  }'

Available events:

track.streamedtrack.uploadedticket.purchasedticket.transferredevent.createdevent.sold_outpayout.completedsubscriber.new

Rate Limits

PlanRequests / MinuteDaily Limit
Free6010,000
Pro1,000500,000
Enterprise10,000Unlimited

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

SDKs

Official client libraries to speed up your integration.

Node.js

Availablenpm install @opynx/sdk

Python

Coming Soonpip install opynx

Go

Coming Soongo get github.com/opynx/sdk-go