A robust, type-safe Ruby SDK designed for seamless integration with the FastPix API platform.
The FastPix Ruby SDK simplifies integration with the FastPix platform. It provides a clean, typed interface for secure and efficient communication with the FastPix API, enabling easy management of media uploads, live streaming, on‑demand content, playlists, video analytics, and signing keys for secure access and token management. It is intended for use with Ruby 3.2 and above.
| Requirement | Version | Description |
|---|---|---|
| Ruby | 3.2+ |
Core runtime environment |
| Bundler | Latest |
Dependency management |
| Internet | Required |
API communication and authentication |
Pro Tip: We recommend using Ruby 3.2+ for optimal performance and the latest language features.
To get started with the FastPix Ruby SDK, ensure you have the following:
- The FastPix APIs are authenticated using a Username and a Password. You must generate these credentials to use the SDK.
- Follow the steps in the Authentication with Basic Auth guide to obtain your credentials.
Configure your FastPix credentials using environment variables for enhanced security and convenience:
# Set your FastPix credentials
export FASTPIX_USERNAME="your-access-token"
export FASTPIX_PASSWORD="your-secret-key"Security Note: Never commit your credentials to version control. Use environment variables or secure credential management systems.
Install the FastPix Ruby SDK using Bundler. Add to your Gemfile:
gem 'fastpixapi'Then run:
bundle installOr install the gem directly:
gem install fastpixapiRequire the SDK and use the client namespace:
require 'json'
require 'fastpixapi'
Models = ::FastpixClient::ModelsInitialize the FastPix SDK with your credentials:
require 'fastpixapi'
Models = ::FastpixClient::Models
s = ::FastpixClient::Fastpixapi.new(
security: Models::Components::Security.new(
username: 'your-access-token',
password: 'your-secret-key'
)
)Or using environment variables:
require 'fastpixapi'
Models = ::FastpixClient::Models
s = ::FastpixClient::Fastpixapi.new(
security: Models::Components::Security.new(
username: ENV['FASTPIX_USERNAME'], # Your Access Token
password: ENV['FASTPIX_PASSWORD'] # Your Secret Key
)
)require 'json'
require 'fastpixapi'
Models = ::FastpixClient::Models
s = ::FastpixClient::Fastpixapi.new(
security: Models::Components::Security.new(
username: 'your-access-token',
password: 'your-secret-key'
)
)
req = Models::Components::CreateMediaRequest.new(
inputs: [
Models::Components::PullVideoInput.new(
type: 'video',
url: 'https://static.fastpix.io/fp-sample-video.mp4',
),
],
metadata: { 'key1' => 'value1' },
)
begin
res = s.input_video.create_media(request: req)
puts JSON.pretty_generate(JSON.parse(res.raw_response.body))
rescue FastpixClient::Models::Errors::APIError => e
puts JSON.pretty_generate(JSON.parse(e.body))
rescue StandardError
puts res.raw_response.body.to_s if defined?(res) && res&.raw_response
endComprehensive Ruby SDK for FastPix platform integration with full API coverage.
Upload, manage, and transform video content with comprehensive media management capabilities.
For detailed documentation, see FastPix Video on Demand Overview.
- Create from URL - Upload video content from external URL
- Upload from Device - Upload video files directly from device
- List All Media - Retrieve complete list of all media files
- Get Media by ID - Get detailed information for specific media
- Update Media - Modify media metadata and settings
- Delete Media - Remove media files from library
- Cancel Upload - Stop ongoing media upload process
- Get Input Info - Retrieve detailed input information
- List Uploads - Get all available upload URLs
- Get Media Clips - Get all clips of a media
- Get Media Summary - Get the summary of a video
- Update Source Access - Update the source access of a media by ID
- Update MP4 Support - Update the mp4Support of a media by ID
- Add Media Track - Add audio or subtitle track
- Update Media Track - Update audio or subtitle track
- Delete Media Track - Delete audio or subtitle track
- Generate Subtitle Track - Generate track subtitle
- List Live Clips - Get all clips of a live stream
- Create Playback ID - Generate secure playback identifier
- List Playback IDs - Get all playback IDs details for a media
- Delete Playback ID - Remove playback access
- Get Playback ID - Retrieve playback configuration details
- Update Domain Restrictions - Update domain restrictions for a playback ID
- Update User-Agent Restrictions - Update user-agent restrictions for a playback ID
- Create Playlist - Create new video playlist
- List Playlists - Get all available playlists
- Get Playlist - Retrieve specific playlist details
- Update Playlist - Modify playlist settings and metadata
- Delete Playlist - Remove playlist from library
- Add Media - Add media items to playlist
- Change Media Order - Change order of media in playlist
- Delete Media from Playlist - Remove media from playlist
- Create Key - Generate new signing key pair
- List Keys - Get all available signing keys
- Delete Key - Remove signing key from system
- Get Key by ID - Retrieve specific signing key details
- List DRM Configs - Get all DRM configuration options
- Get DRM Config - Retrieve specific DRM configuration
Stream, manage, and transform live video content with real-time broadcasting capabilities.
For detailed documentation, see FastPix Live Stream Overview.
- Create Stream - Initialize new live streaming session
- List Streams - Retrieve all active live streams
- Get Viewer Count - Get real-time viewer statistics
- Get Stream - Retrieve detailed stream information
- Delete Stream - Terminate and remove live stream
- Update Stream - Modify stream settings and configuration
- Enable Stream - Activate live streaming
- Disable Stream - Pause live streaming
- Complete Stream - Finalize and archive stream
- Create Playback ID - Generate secure live playback access
- Delete Playback ID - Revoke live playback access
- Get Playback ID - Retrieve live playback configuration
- Create Simulcast - Set up multi-platform streaming
- Delete Simulcast - Remove simulcast configuration
- Get Simulcast - Retrieve simulcast settings
- Update Simulcast - Modify simulcast parameters
Monitor video performance and quality with comprehensive analytics and real-time metrics.
For detailed documentation, see FastPix Video Data Overview.
- List Breakdown Values - Get detailed breakdown of metrics by dimension
- List Overall Values - Get aggregated metric values across all content
- Get Timeseries Data - Retrieve time-based metric trends and patterns
- List Comparison Values - List comparison values
- List Video Views - Get comprehensive list of video viewing sessions
- Get View Details - Retrieve detailed information about specific video views
- List Top Content - Find your most popular and engaging content
- List Dimensions - Get available data dimensions for filtering and analysis
- List Filter Values - Get specific values for a particular dimension
- List Errors - List errors
Transform and enhance your video content with AI and editing capabilities.
- Update Summary - Create AI-generated video summaries
- Generate Chapters - Automatically generate video chapter markers
- Extract Entities - Identify and extract named entities from content
- Enable Moderation - Activate content moderation and safety checks
FastpixClient::Models::Errors::APIError is the primary error class for HTTP error responses. It has the following properties:
| Property | Type | Description |
|---|---|---|
message |
String |
Error message |
status_code |
Integer |
HTTP response status code (e.g. 404) |
raw_response |
Faraday::Response |
Raw HTTP response |
body |
String |
HTTP body. Can be empty if no body is returned. |
require 'json'
require 'fastpixapi'
Models = ::FastpixClient::Models
s = ::FastpixClient::Fastpixapi.new(
security: Models::Components::Security.new(
username: 'your-access-token',
password: 'your-secret-key'
)
)
begin
req = Models::Components::CreateMediaRequest.new(
inputs: [
Models::Components::PullVideoInput.new(
type: 'video',
url: 'https://static.fastpix.io/fp-sample-video.mp4',
),
],
metadata: { 'key1' => 'value1' },
)
res = s.input_video.create_media(request: req)
puts JSON.pretty_generate(JSON.parse(res.raw_response.body))
rescue FastpixClient::Models::Errors::APIError => e
puts e.message
puts e.status_code
puts e.body
rescue StandardError
puts res.raw_response.body.to_s if defined?(res) && res&.raw_response
endThe default server can be overridden globally by passing a URL to the server_url optional parameter when initializing the SDK client instance:
require 'json'
require 'fastpixapi'
Models = ::FastpixClient::Models
s = ::FastpixClient::Fastpixapi.new(
server_url: 'https://api.fastpix.io/v1/',
security: Models::Components::Security.new(
username: 'your-access-token',
password: 'your-secret-key'
)
)
req = Models::Components::CreateMediaRequest.new(
inputs: [
Models::Components::PullVideoInput.new(
type: 'video',
url: 'https://static.fastpix.io/fp-sample-video.mp4',
),
],
metadata: { 'key1' => 'value1' },
)
begin
res = s.input_video.create_media(request: req)
puts JSON.pretty_generate(JSON.parse(res.raw_response.body))
rescue FastpixClient::Models::Errors::APIError => e
puts JSON.pretty_generate(JSON.parse(e.body))
rescue StandardError
puts res.raw_response.body.to_s if defined?(res) && res&.raw_response
endThis Ruby SDK is programmatically generated from our API specifications. Any manual modifications to internal files may be overwritten during subsequent generation cycles.
We value community contributions and feedback. Feel free to submit pull requests or open issues with your suggestions, and we'll do our best to include them in future releases.
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version so you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
For comprehensive understanding of each API's functionality, including detailed request and response specifications, parameter descriptions, and additional examples, please refer to the FastPix API Reference.
The API reference offers complete documentation for all available endpoints and features, enabling developers to integrate and leverage FastPix APIs effectively.