इसे छोड़कर कंटेंट पर जाएं

Proyecta AI Gateway

अपने published app में AI features जोड़ें — chatbots, content generation, summarization। OpenAI-compatible। कोई third-party API keys की ज़रूरत नहीं।

Proyecta AI Gateway की मदद से तुम्हारे बनाए apps frontier LLMs को call कर सकते हैं — बिना हर provider पर account बनाए, उनकी API keys manage किए, या खुद cost उठाए। यह OpenAI-compatible है — OpenAI SDK को gateway की तरफ point करो और काम हो गया। फ़िलहाल, gateway के ज़रिए सिर्फ Anthropic Claude models उपलब्ध हैं। OpenAI, Google, और Groq support roadmap पर है।

इससे क्या बना सकते हो?

Section titled “इससे क्या बना सकते हो?”
  • Chatbots — customer support, AI coaching, FAQ bots
  • Content generation — descriptions, emails, summaries, drafts
  • Analysis — text से insights निकालना, data categorize करना, classify करना
  • Summarization — documents, articles, transcripts को संक्षिप्त करना
  • Personalization — recommendations, adaptive UI

Proyecta से बने app में तुम useAI() hook की मदद से सीधे अपने pages से gateway को call कर सकते हो — कोई key handling नहीं, कोई backend नहीं:

import { useAI } from '@/hooks/useAI.ts';
function Summarizer({ article }) {
const { ask, isPending, error } = useAI({ system: 'You summarize articles.' });
const [summary, setSummary] = useState('');
return (
<button
disabled={isPending}
onClick={async () => setSummary(await ask(`Summarize in 3 bullets: ${article}`))}
>
Summarize
</button>
);
}

आगे-पीछे की बातचीत के लिए useChat() का इस्तेमाल करो, जो message history अपने आप संभालता है।

दो ज़रूरी बातें, क्योंकि कोई anonymous visitor तुम्हारे credits खर्च करता है: prompts को bounded रखो (पूरा collection system में stream मत करो), और हर keystroke पर completion fire मत करो।

AI builder से कहो कि यह setup करे: "Add a chatbot to my app. The user types a question and gets a streaming response."

अपने खुद के backend से

Section titled “अपने खुद के backend से”

Gateway OpenAI Chat Completions protocol बोलता है, इसलिए अपने server से official OpenAI SDK को उसकी तरफ point कर सकते हो — बस दो बदलाव, baseURL और key:

import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'https://cloud.proyecta.dev/v1/ai',
apiKey: process.env.PROYECTA_API_KEY,
});
const response = await openai.chat.completions.create({
model: 'claude-haiku-4-5-20251001',
messages: [{ role: 'user', content: 'Summarize this article in 3 bullet points: …' }],
});

Streaming किसी भी OpenAI-compatible client की तरह काम करता है:

const stream = await openai.chat.completions.create({
model: 'claude-haiku-4-5-20251001',
messages: [{ role: 'user', content: prompt }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}

Gateway के ज़रिए निम्नलिखित models उपलब्ध हैं:

Provider Supported models
Anthropic claude-sonnet-5 (flagship), claude-sonnet-4-6, claude-haiku-4-5-20251001, claude-opus-5, claude-opus-4-8, claude-opus-4-7

Model ID सीधे pass करो, जैसे claude-sonnet-5, claude-haiku-4-5-20251001। इस list से बाहर किसी भी model के लिए request reject हो जाएगी। Additional providers roadmap पर हैं।

Proyecta तुम्हारे runtime के लिए अपने आप एक PROYECTA_API_KEY provision करता है। सामान्य use के लिए इसे manually बनाने की ज़रूरत नहीं है।

Organization owners AI credits का usage देख सकते हैं — current period का खर्च और उनके plan का budget cap। यही builder में credits indicator को power करता है।

AI Gateway का usage उन credits से अलग track होता है जो AI builder तुम्हारा app edit करते वक्त खर्च करता है। Per-request cost underlying provider की rate होती है, जो तुम्हारे org के AI credits balance से काटी जाती है।

AI Gateway और AI builder में क्या फ़र्क है?

AI builder वह agent है जो chat panel में code लिखता है। AI Gateway वह है जिसे तुम्हारा published app तब call करता है जब उसके users कोई AI feature इस्तेमाल करना चाहते हैं।

क्या मैं अपने खुद के provider keys ला सकता हूँ?

हाँ — AI से कहो कि gateway calls हटा दे और Environment Variables में अपनी खुद की key के साथ direct integration configure करे। इससे unified billing और shared rate limit pool की सुविधा नहीं मिलेगी।

क्या इसे image या voice generation के लिए इस्तेमाल कर सकते हैं?

अभी नहीं। फ़िलहाल gateway text-in / text-out है। Image, voice, और video modalities roadmap पर हैं। Image generation के लिए Image Generation देखो।

Usage कहाँ देख सकते हैं?

Credits का usage Settings page में organization level पर दिखता है (current period का खर्च और budget cap)। Builder के अंदर एक dedicated AI Gateway panel — per-app keys और live usage charts के साथ — roadmap पर है।

जल्द आने वाला है

Section titled “जल्द आने वाला है”
  • Builder panel for AI Gateway — per-app keys बनाओ, model allowlists set करो, live spend देखो, और सब कुछ builder से बाहर निकले बिना manage करो
  • Image और voice modalities — text-to-image, text-to-speech, speech-to-text
  • Per-runtime usage attribution — देखो कि तुम्हारे org के कौन से apps कितना खर्च कर रहे हैं