Skip to main content
The Ruby XDK (xdk) is the official Ruby client library for the X API v2, generated from the X API OpenAPI specification.
  • Package: xdk on RubyGems (0.1.0)
  • Repository: xdevplatform/xdk-ruby
  • Runtime: Ruby 3.0+ with zero runtime gem dependencies (pure stdlib net/http, openssl, json)

Install

Add xdk via RubyGems or Bundler

Quickstart

Make your first X API v2 call in Ruby

Authentication

Bearer Token, OAuth 2.0 PKCE, and OAuth 1.0a

Pagination & Streaming

Lazy Enumerators and resilient real-time streams

Encrypted X Chat DMs

Pair xdk with the official Ruby Chat XDK (gem install chat_xdk) to handle X Chat end-to-end encryption, decryption, and signing alongside /2/chat/* REST calls.