@subscribe.dev/replicate-frontend-proxy
Version:
AWS Lambda function that serves as a secure proxy for the Replicate API
38 lines (37 loc) • 895 B
TypeScript
export interface ReplicateRequest {
model: string;
input?: Record<string, any>;
apiKey: string;
}
export interface HealthResponse {
status: 'ok';
message: string;
timestamp?: string;
requestId?: string;
}
export interface ApiInstructionsResponse {
message: string;
instructions: {
method: string;
endpoint: string;
body: {
model: string;
input: string;
apiKey: string;
};
};
}
export interface ErrorResponse {
error: string;
details?: string;
statusCode?: number;
requestId?: string;
timestamp?: string;
stack?: string;
}
export declare const isValidApiKey: (apiKey: string) => boolean;
export declare const isValidModelName: (model: string) => boolean;
export declare const validateReplicateRequest: (body: any) => {
isValid: boolean;
error?: string;
};