Learn how to use Conduit Link with popular APIs. Simply override the base URL in your favorite SDK or API client to route requests through your secure proxy.
allowed_paths
in your Conduit Link settings to prevent unauthorized access to sensitive endpoints. For example, allow only /v1/chat/completions
for ChatGPT instead of exposing all OpenAI endpoints.The allowed_paths
setting is crucial for securing your API proxy. It acts as a whitelist, ensuring only specific endpoints can be accessed through your Conduit Link.
Example configuration in your Conduit Link:
{
"allowed_paths": [
"/v1/chat/completions", // ChatGPT conversations only
"/v1/embeddings", // Text embeddings
"/v1/models" // List available models
]
// Blocked by default: /v1/files, /v1/fine-tunes, /v1/organizations, etc.
}
JWT (JSON Web Token) verification adds an extra layer of security by authenticating individual users. This enables user-specific rate limiting, usage tracking, and access control at the user level.
Implementation example:
// 1. Configure JWT verification in your Conduit Link settings
{
"jwt_verification": {
"enabled": true,
"secret": "your-jwt-secret-key",
"algorithm": "HS256"
}
}
// 2. Generate a JWT for each user in your backend
import jwt from 'jsonwebtoken';
const userToken = jwt.sign(
{
userId: user.id,
email: user.email,
role: user.role,
// Optional: Add expiration
exp: Math.floor(Date.now() / 1000) + (60 * 60) // 1 hour
},
process.env.JWT_SECRET
);
// 3. Include the JWT in API requests
const response = await fetch('https://proxy.conduit.link/YOUR_LINK_ID/v1/chat/completions', {
method: 'POST',
headers: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
'Authorization': `Bearer ${userToken}`, // User's JWT
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'gpt-3.5-turbo',
messages: [{ role: 'user', content: 'Hello!' }],
}),
});
⚠️ Important: Never generate JWTs on the client side. Always create them in your secure backend to prevent token forgery and maintain control over user authentication.
Use ChatGPT and other OpenAI models without exposing your API key
https://api.openai.com/v1
https://proxy.conduit.link/YOUR_LINK_ID/v1
Add these to your allowed_paths
setting:
[
"/v1/chat/completions",
"/v1/completions",
"/v1/embeddings",
"/v1/images/generations",
"/v1/audio/transcriptions",
"/v1/models"
]
import OpenAI from 'openai';
// Instead of exposing your API key in the client
const openai = new OpenAI({
apiKey: 'dummy-key', // Real key is stored in Conduit Link
baseURL: 'https://proxy.conduit.link/YOUR_LINK_ID/v1',
defaultHeaders: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
// Optional: Add JWT for user-specific rate limiting
'Authorization': 'Bearer YOUR_USER_JWT_TOKEN'
},
dangerouslyAllowBrowser: true // Required for client-side usage
});
// Use the SDK normally
const completion = await openai.chat.completions.create({
model: "gpt-3.5-turbo",
messages: [
{ role: "user", content: "Hello, how are you?" }
],
});
console.log(completion.choices[0].message);
// Direct API call without SDK
const response = await fetch('https://proxy.conduit.link/YOUR_LINK_ID/v1/chat/completions', {
method: 'POST',
headers: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
'Content-Type': 'application/json',
// Optional: Add JWT for user-specific rate limiting
'Authorization': 'Bearer YOUR_USER_JWT_TOKEN'
},
body: JSON.stringify({
model: 'gpt-3.5-turbo',
messages: [
{ role: 'user', content: 'Explain quantum computing in simple terms' }
],
temperature: 0.7,
}),
});
const data = await response.json();
console.log(data.choices[0].message.content);
// Handle streaming responses
const response = await fetch('https://proxy.conduit.link/YOUR_LINK_ID/v1/chat/completions', {
method: 'POST',
headers: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'gpt-3.5-turbo',
messages: [{ role: 'user', content: 'Write a story' }],
stream: true,
}),
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
console.log(chunk); // Process each chunk
}
Process payments securely without exposing your Stripe secret key
https://api.stripe.com/v1
https://proxy.conduit.link/YOUR_LINK_ID/v1
Add these to your allowed_paths
setting:
[
"/v1/customers",
"/v1/payment_intents",
"/v1/payment_methods",
"/v1/subscriptions",
"/v1/prices",
"/v1/products",
"/v1/checkout/sessions"
]
import Stripe from 'stripe';
// Configure Stripe to use Conduit Link
const stripe = new Stripe('dummy-key', {
apiVersion: '2023-10-16',
host: 'proxy.conduit.link',
protocol: 'https',
port: 443,
basePath: '/YOUR_LINK_ID/v1',
httpAgent: {
defaultHeaders: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
// Optional: Add JWT for user-specific rate limiting
'Authorization': 'Bearer YOUR_USER_JWT_TOKEN'
}
}
});
// Create a customer
const customer = await stripe.customers.create({
email: '[email protected]',
name: 'John Doe',
});
// Create a payment intent
const paymentIntent = await stripe.paymentIntents.create({
amount: 2000, // $20.00
currency: 'usd',
customer: customer.id,
});
// Create a Stripe customer without SDK
const response = await fetch('https://proxy.conduit.link/YOUR_LINK_ID/v1/customers', {
method: 'POST',
headers: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
'Content-Type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams({
email: '[email protected]',
name: 'Jane Smith',
description: 'Premium customer',
}),
});
const customer = await response.json();
console.log('Customer created:', customer.id);
Use Google Maps APIs without exposing your API key in frontend code
https://maps.googleapis.com/maps/api
https://proxy.conduit.link/YOUR_LINK_ID
Add these to your allowed_paths
setting:
[
"/geocode/json",
"/place/autocomplete/json",
"/place/details/json",
"/directions/json",
"/distancematrix/json",
"/elevation/json",
"/timezone/json"
]
// Geocode an address securely
async function geocodeAddress(address) {
const response = await fetch(
`https://proxy.conduit.link/YOUR_LINK_ID/geocode/json?${new URLSearchParams({
address: address,
})}`,
{
headers: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
},
}
);
const data = await response.json();
return data.results[0]?.geometry.location;
}
// Usage
const location = await geocodeAddress('1600 Amphitheatre Parkway, Mountain View, CA');
console.log('Coordinates:', location); // { lat: 37.4224764, lng: -122.0842499 }
// Implement places autocomplete
async function getPlaceSuggestions(input) {
const response = await fetch(
`https://proxy.conduit.link/YOUR_LINK_ID/place/autocomplete/json?${new URLSearchParams({
input: input,
types: 'establishment',
language: 'en',
})}`,
{
headers: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
},
}
);
const data = await response.json();
return data.predictions.map(p => ({
description: p.description,
placeId: p.place_id,
}));
}
// React component example
function PlaceSearch() {
const [query, setQuery] = useState('');
const [suggestions, setSuggestions] = useState([]);
useEffect(() => {
if (query.length > 2) {
getPlaceSuggestions(query).then(setSuggestions);
}
}, [query]);
return (
<input
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Search for a place..."
/>
);
}
Use Claude API securely without client-side key exposure
https://api.anthropic.com
https://proxy.conduit.link/YOUR_LINK_ID
Add these to your allowed_paths
setting:
[
"/v1/messages",
"/v1/complete"
]
// Using Anthropic's Claude API
const response = await fetch('https://proxy.conduit.link/YOUR_LINK_ID/v1/messages', {
method: 'POST',
headers: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
'Content-Type': 'application/json',
'anthropic-version': '2023-06-01',
// Optional: Add JWT for user-specific rate limiting
'Authorization': 'Bearer YOUR_USER_JWT_TOKEN'
},
body: JSON.stringify({
model: 'claude-3-opus-20240229',
max_tokens: 1024,
messages: [
{
role: 'user',
content: 'What are the key differences between REST and GraphQL?'
}
],
}),
});
const data = await response.json();
console.log(data.content[0].text);
Send emails through SendGrid without exposing your API key
https://api.sendgrid.com/v3
https://proxy.conduit.link/YOUR_LINK_ID
Add these to your allowed_paths
setting:
[
"/mail/send",
"/mail/batch",
"/marketing/contacts",
"/marketing/lists"
]
// Send an email using SendGrid
const response = await fetch('https://proxy.conduit.link/YOUR_LINK_ID/mail/send', {
method: 'POST',
headers: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
personalizations: [
{
to: [{ email: '[email protected]', name: 'Recipient Name' }],
subject: 'Hello from Conduit Link!',
},
],
from: {
email: '[email protected]',
name: 'Your App Name',
},
content: [
{
type: 'text/plain',
value: 'This email was sent securely through Conduit Link!',
},
{
type: 'text/html',
value: '<p>This email was sent <strong>securely</strong> through Conduit Link!</p>',
},
],
}),
});
if (response.ok) {
console.log('Email sent successfully!');
} else {
console.error('Failed to send email:', await response.text());
}
Send SMS and make calls without exposing Twilio credentials
https://api.twilio.com/2010-04-01
https://proxy.conduit.link/YOUR_LINK_ID
Add these to your allowed_paths
setting:
[
"/Accounts/*/Messages.json",
"/Accounts/*/Calls.json",
"/Accounts/*/IncomingPhoneNumbers.json",
"/Accounts/*/AvailablePhoneNumbers/*"
]
// Send an SMS message
const accountSid = 'YOUR_TWILIO_ACCOUNT_SID'; // This can be public
const response = await fetch(
`https://proxy.conduit.link/YOUR_LINK_ID/Accounts/${accountSid}/Messages.json`,
{
method: 'POST',
headers: {
'X-Access-Token': 'YOUR_CONDUIT_ACCESS_TOKEN',
'Content-Type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams({
To: '+1234567890',
From: '+0987654321', // Your Twilio phone number
Body: 'Hello from Conduit Link! Your verification code is: 123456',
}),
}
);
const message = await response.json();
console.log('Message sent:', message.sid);
Start using Conduit Link to protect your API keys and build secure applications.
Connect Securely. Ship Faster.
© 2025 Conduit Link. All rights reserved.
Developers
Support