---
title: "OpenAI कनेक्टर"
description: "Tajo के माध्यम से Brevo के साथ AI-powered content generation, customer insights, और intelligent marketing automation के लिए संपूर्ण OpenAI integration guide।"
url: https://tajo.io/hi/docs/connectors/custom/openai/
markdown: https://tajo.io/hi/docs/connectors/custom/openai.md
lang: hi-IN
robots: noindex
---

अर्ली एक्सेस का अनुरोध करें

अपना पहला नाम और कार्यस्थल का ईमेल पता दर्ज करें। Tajo एक्सेस अनुरोध की पुष्टि के लिए हम आपको एक लिंक ईमेल करेंगे।

# OpenAI कनेक्टर

कनेक्टर की स्थिति: नियोजित अभी बना नहीं है। Tajo आज यह कनेक्टर नहीं चलाता।

| स्रोत फ़ील्ड | गंतव्य फ़ील्ड | नमूना मान |
| --- | --- | --- |
| `record.id` | `source_id` | `record_1042` |
| `record.updated_at` | `updated_at` | `2026-10-18T08:00:00Z` |
| `record.value` | `value` | `sample_value` |

अपने marketing automation workflows के लिए AI-powered content generation, customer sentiment analysis, intelligent segmentation, और predictive analytics का लाभ उठाने हेतु Tajo के माध्यम से OpenAI को Brevo से कनेक्ट करें।

## अवलोकन

| Property | Value |
| --- | --- |
| **Platform** | OpenAI |
| **Category** | AI / ML (Custom) |
| **Setup Complexity** | Medium |
| **Official Integration** | No |
| **Data Synced** | Content, Embeddings, Insights, Predictions |
| **Auth Method** | API Key (Bearer Token) |

## विशेषताएं

- **AI content generation** - GPT models के साथ email subject lines, body copy, और CTAs generate करें
- **Customer sentiment analysis** - sentiment scoring के लिए support tickets और feedback का विश्लेषण करें
- **Smart segmentation** - behavior patterns द्वारा customers को cluster करने के लिए embeddings का उपयोग करें
- **Predictive analytics** - churn, LTV, और purchase propensity का पूर्वानुमान लगाएं
- **Multi-language content** - किसी भी supported language में marketing content generate करें
- **Image generation** - DALL-E integration के साथ campaign visuals बनाएं

## पूर्वावश्यकताएं

शुरू करने से पहले, सुनिश्चित करें कि आपके पास हैं:

1. API access वाला एक OpenAI account
2. [OpenAI dashboard](https://platform.openai.com/api-keys) से एक API key
3. API access वाला एक Brevo account
4. connector permissions वाला एक Tajo account
5. अपने अपेक्षित उपयोग के लिए पर्याप्त OpenAI API credits

## प्रमाणीकरण

### API Key Authentication

OpenAI सभी API requests के लिए Bearer token authentication का उपयोग करता है:

```bash
# अपनी API keys सेट करें
export OPENAI_API_KEY=sk-your-api-key
export TAJO_API_KEY=your_tajo_api_key
export BREVO_API_KEY=your_brevo_api_key
```

```javascript
// सभी requests के लिए Authorization header आवश्यक है
const headers = {
  'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`,
  'Content-Type': 'application/json'
};

// organization-scoped access के लिए
const orgHeaders = {
  ...headers,
  'OpenAI-Organization': process.env.OPENAI_ORG_ID,
  'OpenAI-Project': process.env.OPENAI_PROJECT_ID
};
```

API Key Security

अपनी OpenAI API key को कभी भी client-side code में expose न करें। हमेशा environment variables और server-side requests का उपयोग करें। OpenAI dashboard के माध्यम से keys को समय-समय पर rotate करें।

## कॉन्फ़िगरेशन

### बेसिक सेटअप

```yaml
connectors:
  openai:
    enabled: true
    model: "gpt-4o"
    embedding_model: "text-embedding-3-small"
    image_model: "dall-e-3"

    features:
      content_generation: true
      sentiment_analysis: true
      smart_segmentation: true
      predictive_analytics: true

    limits:
      max_tokens_per_request: 4096
      max_requests_per_minute: 60
      temperature: 0.7
```

### Content Generation Templates

```yaml
templates:
  email_subject:
    model: "gpt-4o"
    system_prompt: |
      आप एक expert email marketer हैं। ऐसी compelling
      subject lines generate करें जो open rates बढ़ाएं।
    max_tokens: 100
    temperature: 0.8

  email_body:
    model: "gpt-4o"
    system_prompt: |
      customer data और campaign objectives के आधार पर
      personalized email content generate करें।
    max_tokens: 2048
    temperature: 0.7
```

## API Endpoints

| Endpoint | Method | विवरण |
| --- | --- | --- |
| `https://api.openai.com/v1/responses` | POST | AI responses बनाएं (Responses API) |
| `https://api.openai.com/v1/chat/completions` | POST | text completions generate करें |
| `https://api.openai.com/v1/embeddings` | POST | text embeddings बनाएं |
| `https://api.openai.com/v1/images/generations` | POST | images generate करें |
| `https://api.openai.com/v1/audio/speech` | POST | Text-to-speech generation |
| `https://api.openai.com/v1/audio/transcriptions` | POST | Speech-to-text transcription |
| `https://api.openai.com/v1/moderations` | POST | Content moderation |
| `https://api.openai.com/v1/models` | GET | उपलब्ध models list करें |

## कोड उदाहरण

### कनेक्टर शुरू करें

```javascript
import { TajoClient } from '@tajo/sdk';

const tajo = new TajoClient({
  apiKey: process.env.TAJO_API_KEY,
  brevoApiKey: process.env.BREVO_API_KEY
});

await tajo.connectors.connect('openai', {
  apiKey: process.env.OPENAI_API_KEY,
  defaultModel: 'gpt-4o'
});
```

### Email Content Generate करें

```javascript
// personalized email subject lines generate करें
const response = await fetch('https://api.openai.com/v1/chat/completions', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'gpt-4o',
    messages: [
      {
        role: 'system',
        content: 'Generate 5 compelling email subject lines for a product launch.'
      },
      {
        role: 'user',
        content: `Product: ${product.name}. Target: ${segment.description}.`
      }
    ],
    max_tokens: 200,
    temperature: 0.8
  })
});

const result = await response.json();
const subjectLines = result.choices[0].message.content;
```

### Customer Sentiment Analysis

```javascript
// customer feedback sentiment का विश्लेषण करें
const sentimentAnalysis = await fetch(
  'https://api.openai.com/v1/chat/completions',
  {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      model: 'gpt-4o',
      messages: [
        {
          role: 'system',
          content: 'Analyze sentiment. Return JSON: {score: -1 to 1, label: string, topics: string[]}'
        },
        { role: 'user', content: customerFeedback }
      ],
      response_format: { type: 'json_object' },
      max_tokens: 150
    })
  }
);

const sentiment = await sentimentAnalysis.json();
await tajo.contacts.update(email, {
  attributes: { SENTIMENT_SCORE: JSON.parse(sentiment.choices[0].message.content).score }
});
```

### Embeddings के साथ Smart Segmentation

```javascript
// customer clustering के लिए embeddings generate करें
const embeddingResponse = await fetch(
  'https://api.openai.com/v1/embeddings',
  {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      model: 'text-embedding-3-small',
      input: customerDescriptions,
      dimensions: 256
    })
  }
);

const embeddings = await embeddingResponse.json();
// similarity-आधारित customer clustering के लिए embeddings का उपयोग करें
```

## Rate Limits

| Model | RPM (Requests/Min) | TPM (Tokens/Min) | RPD (Requests/Day) |
| --- | --- | --- | --- |
| gpt-4o | 500 | 30,000 | 10,000 |
| gpt-4o-mini | 500 | 200,000 | 10,000 |
| text-embedding-3-small | 500 | 1,000,000 | 10,000 |
| dall-e-3 | 5 | N/A | 200 |

Rate Limit Headers

API responses में rate limit headers (`x-ratelimit-remaining-requests`, `x-ratelimit-remaining-tokens`) को monitor करें ताकि सक्रिय throttling लागू कर सकें और 429 errors से बच सकें।

## समस्या निवारण

| समस्या | कारण | समाधान |
| --- | --- | --- |
| 401 Unauthorized | अमान्य API key | OpenAI dashboard में key सत्यापित करें |
| 429 Rate Limited | बहुत अधिक requests | exponential backoff लागू करें |
| 500 Server Error | OpenAI outage | status.openai.com जांचें और retry करें |
| Truncated response | max\_tokens बहुत कम | max\_tokens parameter बढ़ाएं |
| खराब content quality | Temperature बहुत अधिक | consistency के लिए temperature कम करें |

### Debug Mode

```yaml
connectors:
  openai:
    debug: true
    log_level: verbose
    log_prompts: false  # production में prompts log न करें
    log_usage: true
```

## सर्वोत्तम प्रथाएं

1. **Responses cache करें** - API calls और costs कम करने के लिए generated content store करें
2. **Structured outputs का उपयोग करें** - विश्वसनीय parsing के लिए JSON responses का अनुरोध करें
3. **Retry logic लागू करें** - exponential backoff के साथ rate limits संभालें
4. **Token usage monitor करें** - costs नियंत्रित करने के लिए consumption ट्रैक करें
5. **उपयुक्त models का उपयोग करें** - सरल कार्यों के लिए gpt-4o-mini, जटिल कार्यों के लिए gpt-4o का उपयोग करें
6. **Outputs validate करें** - customers को भेजने से पहले हमेशा AI-generated content validate करें

## सुरक्षा

- **Bearer token auth** - API keys Authorization header के माध्यम से transmit होती हैं
- **Server-side only** - API keys को कभी भी client-side code में expose न करें
- **Key rotation** - OpenAI dashboard के माध्यम से API keys को नियमित रूप से rotate करें
- **Usage monitoring** - OpenAI billing settings में spending limits सेट करें
- **Content moderation** - unsafe content filter करने के लिए Moderations API का उपयोग करें
- **Data privacy** - अपने use case के लिए OpenAI की data usage policies की समीक्षा करें

## संबंधित संसाधन

- [Brevo कनेक्टर](https://tajo.io/hi/docs/connectors/marketing/brevo)
- [Customer Sync Skill](https://tajo.io/hi/docs/skills/data-sync/customer-sync)
- [Email Marketing Skills](https://tajo.io/hi/docs/skills/email-marketing)
- [OpenAI API Reference](https://platform.openai.com/docs/api-reference)
