Documentation Index Fetch the complete documentation index at: https://docs.raily.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Raily integrates seamlessly with your existing infrastructure. Whether you’re connecting to AI providers, configuring storage, setting up vector databases, or building custom integrations, we’ve got you covered.
LLM Providers Connect with OpenAI, Anthropic, Google, and more
Storage Store content in S3 or Raily’s managed storage
Vector Store Use Qdrant, S3 Vectors, or Raily’s vector database
Analytics Track usage and optimize your data delivery
Integration Methods
Raily supports multiple integration patterns:
Direct API Integration
The most flexible approach. Use our REST API directly in your application.
import Raily from '@raily/sdk' ;
const raily = new Raily ({ apiKey: process . env . RAILY_API_KEY });
// Register content
await raily . content . create ({ ... });
// Check access
const access = await raily . access . check ({ ... });
SDK Libraries
Native libraries for popular languages:
Language Package Installation JavaScript/TypeScript @raily/sdknpm install @raily/sdkPython railypip install raily
Webhooks
Receive real-time notifications when events occur:
// Your webhook endpoint receives events like:
{
type : "access.granted" ,
timestamp : "2024-01-15T10:30:00Z" ,
data : {
contentId : "cnt_abc123" ,
requesterId : "partner_openai" ,
permissions : [ "full_access" ]
}
}
CMS Plugins
Pre-built plugins for popular content management systems:
WordPress : One-click plugin from the WordPress directory
Contentful : Native app from the Contentful marketplace
Strapi : Community plugin with lifecycle hooks
Quick Start Examples
OpenAI
Anthropic
LangChain
Protect your content when used with OpenAI’s API: import OpenAI from 'openai' ;
import Raily from '@raily/sdk' ;
const openai = new OpenAI ();
const raily = new Raily ({ apiKey: process . env . RAILY_API_KEY });
async function queryWithProtectedContent ( userQuery , contentId ) {
// Check access first
const access = await raily . access . check ({
contentId ,
requesterId: "my_app" ,
context: { purpose: "rag" }
});
if ( ! access . allowed ) {
throw new Error ( `Access denied: ${ access . reason } ` );
}
// Fetch protected content
const contentResponse = await fetch ( access . contentUrl , {
headers: { Authorization: `Bearer ${ access . token } ` }
});
const content = await contentResponse . text ();
// Use with OpenAI
const response = await openai . chat . completions . create ({
model: "gpt-4" ,
messages: [
{ role: "system" , content: `Context: ${ content } ` },
{ role: "user" , content: userQuery }
]
});
return response . choices [ 0 ]. message . content ;
}
Use protected content with Claude: import Anthropic from '@anthropic-ai/sdk' ;
import Raily from '@raily/sdk' ;
const anthropic = new Anthropic ();
const raily = new Raily ({ apiKey: process . env . RAILY_API_KEY });
async function askClaudeWithContent ( question , contentId ) {
const access = await raily . access . check ({
contentId ,
requesterId: "my_claude_app" ,
context: { purpose: "inference" }
});
if ( ! access . allowed ) {
return `Unable to access content: ${ access . reason } ` ;
}
const contentResponse = await fetch ( access . contentUrl );
const content = await contentResponse . text ();
const message = await anthropic . messages . create ({
model: "claude-3-opus-20240229" ,
max_tokens: 1024 ,
messages: [
{
role: "user" ,
content: `Based on this content: \n\n ${ content } \n\n Answer: ${ question } `
}
]
});
return message . content [ 0 ]. text ;
}
Integrate with LangChain for RAG applications: from langchain.llms import OpenAI
from langchain.chains import RetrievalQA
from raily import Raily
raily = Raily( api_key = os.environ[ "RAILY_API_KEY" ])
class RailyRetriever :
def __init__ ( self , content_ids ):
self .content_ids = content_ids
def get_relevant_documents ( self , query ):
documents = []
for content_id in self .content_ids:
access = raily.access.check(
content_id = content_id,
requester_id = "langchain_app" ,
context = { "purpose" : "rag" }
)
if access.allowed:
content = requests.get(access.content_url).text
documents.append(Document( page_content = content))
return documents
# Use in a chain
retriever = RailyRetriever([ "cnt_abc" , "cnt_def" ])
qa = RetrievalQA.from_chain_type(
llm = OpenAI(),
retriever = retriever
)
Authentication
All integrations use API key authentication:
# Header-based authentication
Authorization: Bearer raily_sk_xxxxxxxxxxxx
Generate API keys from your dashboard .
Security Best Practices
Use environment variables for API keys
Never commit keys to version control
Use different keys for development and production
Rotate keys periodically
Rate Limits
Integration rate limits by plan:
Plan Requests/minute Requests/day Starter 60 10,000 Professional 300 100,000 Enterprise Custom Custom
Rate limit headers are included in every response:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 295
X-RateLimit-Reset: 1705320000
Error Handling
All integrations return consistent error responses:
{
"error" : {
"code" : "rate_limit_exceeded" ,
"message" : "Rate limit exceeded. Please retry after 60 seconds." ,
"retryAfter" : 60
}
}
Common error codes:
Code Description invalid_api_keyAPI key is missing or invalid rate_limit_exceededToo many requests content_not_foundContent ID doesn’t exist access_deniedPolicy blocked the request server_errorInternal server error
Storage Options
Raily supports multiple storage backends to fit your infrastructure:
Amazon S3
Store your content in S3 buckets while Raily manages access control and analytics.
await raily . storage . connect ({
provider: 's3' ,
config: {
region: 'us-east-1' ,
bucket: 'your-content-bucket' ,
accessKeyId: process . env . AWS_ACCESS_KEY_ID ,
secretAccessKey: process . env . AWS_SECRET_ACCESS_KEY
}
});
Raily Storage
Use Raily’s fully managed storage with zero configuration and global CDN.
// No configuration needed - just upload
await raily . content . create ({
storage: { provider: "raily" },
file: fileBuffer
});
Vector Store Options
Enable semantic search and AI-powered retrieval:
Qdrant
High-performance vector database for fast similarity search.
S3 Vectors
Cost-effective vector storage using Amazon S3 for large-scale deployments.
Raily Vector Store
Managed vector database with built-in access control and instant setup.
// Index content with embeddings
await raily . vectorStore . index ({
contentId: "cnt_article_123" ,
vector: embedding ,
metadata: { text: "..." }
});
// Semantic search with automatic access control
const results = await raily . vectorStore . search ({
vector: queryEmbedding ,
requesterId: "app_id" ,
limit: 5
});
Next Steps
LLM Providers Integrate with AI providers
Storage Configure content storage
Vector Store Set up semantic search