# AI Extraction Source: https://docs.geekflare.com/ai-extraction-web-scraping Ask AI to answer questions, extract structured data, or analyze scraped web pages using Geekflare's Web Scraping API. Scraping a page is the first step. The next is turning that content into an answer, a structured record, or a summary. **AI Extraction** does that in the same request: pass an `aiPrompt` object alongside your `url`, and Geekflare scrapes the page, feeds the cleaned Markdown to an LLM, and returns the result under `aiResult`. AI Extraction always runs against Markdown content. Any `format` you set in the same request is ignored — you don't need to (and shouldn't) combine `format` with `aiPrompt`. **Endpoint:** `POST https://api.geekflare.com/webscraping` **Credits:** +6 on top of the base scrape cost. *** ## How It Works Every `aiPrompt` object has a required `type` field that selects the extraction mode, plus mode-specific fields: ```json theme={null} { "url": "https://example.com/products/wireless-headphones", "aiPrompt": { "type": "prompt | schema | product | listing | summary | contact | sentiment | keywords", "...": "mode-specific fields below" } } ``` The result is returned under `aiResult` in the response, alongside the usual `data` field (which contains the Markdown content that was analyzed) and `meta`. *** ## 1. `prompt` — Open-Ended Question Ask any question about the page. The model answers strictly from page content and quotes the supporting sentence(s). ```typescript Node.js SDK theme={null} const result = await client.webScrape({ url: 'https://example.com/products/wireless-headphones', aiPrompt: { type: 'prompt', query: 'What is the return policy?' } }); ``` ```python Python SDK theme={null} result = client.web_scrape(WebScrapeDto( url='https://example.com/products/wireless-headphones', ai_prompt={'type': 'prompt', 'query': 'What is the return policy?'} )) ``` ```bash cURL theme={null} curl -X POST https://api.geekflare.com/webscraping \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/products/wireless-headphones", "aiPrompt": {"type": "prompt", "query": "What is the return policy?"} }' ``` | Field | Type | Required | Description | | ------- | ------ | -------- | ---------------------------------- | | `query` | string | yes | Your question, max 1000 characters | ```json theme={null} { "aiResult": { "type": "prompt", "query": "What is the return policy?", "answered": true, "answer": "Items can be returned within 30 days of purchase for a full refund, provided they're unused and in original packaging.", "sourceExcerpt": "..." } } ``` If the answer isn't present in the page content, `answered` is `false` and `answer`/`sourceExcerpt` are `null` — the model never guesses. *** ## 2. `schema` — Custom JSON Schema Extraction Define your own field shape and let AI extract matching data from any page. ```typescript Node.js SDK theme={null} const result = await client.webScrape({ url: 'https://example.com/products/wireless-headphones', aiPrompt: { type: 'schema', schema: { type: 'object', properties: { title: { type: 'string' }, price: { type: 'number' }, currency: { type: 'string' }, inStock: { type: 'boolean' } } } } }); ``` ```python Python SDK theme={null} result = client.web_scrape(WebScrapeDto( url='https://example.com/products/wireless-headphones', ai_prompt={ 'type': 'schema', 'schema': { 'type': 'object', 'properties': { 'title': {'type': 'string'}, 'price': {'type': 'number'}, } } } )) ``` ```bash cURL theme={null} curl -X POST https://api.geekflare.com/webscraping \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/products/wireless-headphones", "aiPrompt": { "type": "schema", "schema": { "type": "object", "properties": { "title": {"type": "string"}, "price": {"type": "number"} } } } }' ``` | Field | Type | Required | Description | | -------- | ------ | -------- | ------------------------------------------------------------------------ | | `schema` | object | yes | JSON Schema-like object describing the fields to extract, max 4000 bytes | ```json theme={null} { "aiResult": { "type": "schema", "data": { "title": "AudioTech Wireless Noise-Cancelling Headphones", "price": 199.99, "currency": "USD", "answered": true, "inStock": true } } } ``` AI extraction output is validated against your schema on a best-effort basis. Fields the model couldn't find are returned as `null` rather than omitted or invented. *** ## 3. `product` — Preset Product Extraction A ready-made schema tuned for e-commerce pages — no schema definition needed. ```typescript Node.js SDK theme={null} const result = await client.webScrape({ url: 'https://example.com/products/wireless-headphones', aiPrompt: { type: 'product' } }); ``` ```python Python SDK theme={null} result = client.web_scrape(WebScrapeDto( url='https://example.com/products/wireless-headphones', ai_prompt={'type': 'product'} )) ``` ```bash cURL theme={null} curl -X POST https://api.geekflare.com/webscraping \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/products/wireless-headphones", "aiPrompt": {"type": "product"} }' ``` No additional fields — `product` takes only `type`. ```json theme={null} { "aiResult": { "type": "product", "data": { "name": "AudioTech Wireless Noise-Cancelling Headphones", "brand": "AudioTech", "price": { "amount": 199.99, "currency": "USD" }, "availability": "in_stock", "rating": { "value": 4.5, "count": 1240 }, "variants": ["Black", "Silver"], "images": ["https://example.com/images/headphones-black.jpg"], "answered": true, "description": "Over-ear wireless headphones with active noise cancellation and 30-hour battery life." } } } ``` `currency` is always returned as an ISO 4217 code (e.g. `USD`, `INR`), never a symbol. If the page isn't a product page, all fields are returned as `null`. *** ## 4. `listing` — Category/Search Page Extraction Extract an array of items from a category or search-results page using your own item schema. ```typescript Node.js SDK theme={null} const result = await client.webScrape({ url: 'https://example.com/category/headphones', aiPrompt: { type: 'listing', itemSchema: { type: 'object', properties: { name: { type: 'string' }, price: { type: 'number' } } }, maxItems: 20 } }); ``` ```python Python SDK theme={null} result = client.web_scrape(WebScrapeDto( url='https://example.com/category/headphones', ai_prompt={ 'type': 'listing', 'item_schema': { 'type': 'object', 'properties': {'name': {'type': 'string'}, 'price': {'type': 'number'}} }, 'max_items': 20 } )) ``` ```bash cURL theme={null} curl -X POST https://api.geekflare.com/webscraping \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/category/headphones", "aiPrompt": { "type": "listing", "itemSchema": { "type": "object", "properties": {"name": {"type": "string"}, "price": {"type": "number"}} }, "maxItems": 20 } }' ``` | Field | Type | Required | Default | Description | | ------------ | ------ | -------- | ------- | ----------------------------------------------------- | | `itemSchema` | object | yes | — | JSON Schema-like object for each item, max 4000 bytes | | `maxItems` | number | no | `20` | Maximum items to extract (1–50) | ```json theme={null} { "aiResult": { "type": "listing", "answered": true, "itemCount": 18, "items": [ { "name": "AudioTech Wireless Headphones", "price": 199.99 }, { "name": "SoundWave Pro Earbuds", "price": 129.00 } ] } } ``` Navigation links, ads, and unrelated content are excluded automatically. Items are returned in page order, capped at `maxItems`. *** ## 5. `summary` — Condensed Page Summary Summarize the page in paragraph, unordered list, or TL;DR form, optionally focused on one topic. ```typescript Node.js SDK theme={null} const result = await client.webScrape({ url: 'https://example.com/blog/state-of-web-scraping-2026', aiPrompt: { type: 'summary', style: 'bullets', focus: 'pricing' } }); ``` ```python Python SDK theme={null} result = client.web_scrape(WebScrapeDto( url='https://example.com/blog/state-of-web-scraping-2026', ai_prompt={'type': 'summary', 'style': 'bullets', 'focus': 'pricing'} )) ``` ```bash cURL theme={null} curl -X POST https://api.geekflare.com/webscraping \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/blog/state-of-web-scraping-2026", "aiPrompt": {"type": "summary", "style": "bullets", "focus": "pricing"} }' ``` | Field | Type | Required | Default | Description | | ----------- | ------ | -------- | ----------- | ---------------------------------------------------------------------- | | `style` | string | no | `paragraph` | `paragraph`, `bullets` (unordered list), or `tldr` | | `focus` | string | no | — | Only summarize content relevant to this topic, max 200 characters | | `maxLength` | number | no | `5` | Sentence count for `paragraph`/`tldr`, item count for `bullets` (1–20) | ```json theme={null} { "aiResult": { "type": "summary", "style": "bullets", "answered": true, "summary": [ "Web scraping demand grew due to AI training data needs and real-time price monitoring.", "Headless browser detection has become the biggest technical hurdle for scrapers in 2026.", "Markdown-based extraction is replacing raw HTML parsing for LLM-based pipelines." ] } } ``` `summary` is a string for `paragraph`/`tldr` style, and an array of strings for `bullets` style. *** ## 6. `contact` — Contact & Company Details Extract company name, emails, phone numbers, address, social links, and business hours from a contact or about page. ```typescript Node.js SDK theme={null} const result = await client.webScrape({ url: 'https://example.com/contact-us', aiPrompt: { type: 'contact' } }); ``` ```python Python SDK theme={null} result = client.web_scrape(WebScrapeDto( url='https://example.com/contact-us', ai_prompt={'type': 'contact'} )) ``` ```bash cURL theme={null} curl -X POST https://api.geekflare.com/webscraping \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/contact-us", "aiPrompt": {"type": "contact"} }' ``` No additional fields — `contact` takes only `type`. ```json theme={null} { "aiResult": { "type": "contact", "answered": true, "data": { "companyName": "Example Corp", "emails": ["support@example.com", "sales@example.com"], "phones": ["+1-800-555-0199"], "address": { "raw": "123 Market Street, Suite 400, San Francisco, CA 94103, USA", "city": "San Francisco", "region": "CA", "country": "USA", "postalCode": "94103" }, "socials": { "linkedin": "https://linkedin.com/company/example-corp", "twitter": "https://twitter.com/examplecorp" }, "hours": "Mon–Fri, 9am–6pm PST" } } } ``` Only data explicitly present in the content is returned — the model never guesses an email or phone number. *** ## 7. `sentiment` — Sentiment Analysis Analyze overall or aspect-based sentiment across reviews, comments, or opinion text on the page. ```typescript Node.js SDK theme={null} const result = await client.webScrape({ url: 'https://example.com/reviews/wireless-headphones', aiPrompt: { type: 'sentiment', aspects: ['sound quality', 'battery life', 'comfort', 'price'] } }); ``` ```python Python SDK theme={null} result = client.web_scrape(WebScrapeDto( url='https://example.com/reviews/wireless-headphones', ai_prompt={ 'type': 'sentiment', 'aspects': ['sound quality', 'battery life', 'comfort', 'price'] } )) ``` ```bash cURL theme={null} curl -X POST https://api.geekflare.com/webscraping \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/reviews/wireless-headphones", "aiPrompt": { "type": "sentiment", "aspects": ["sound quality", "battery life", "comfort", "price"] } }' ``` | Field | Type | Required | Description | | --------- | --------- | -------- | ------------------------------------------------------------------------------ | | `aspects` | string\[] | no | Up to 10 aspects to score individually. Omit to return only overall sentiment. | ```json theme={null} { "aiResult": { "type": "sentiment", "answered": true, "overall": { "label": "positive", "score": 0.78, "distribution": { "positive": 0.72, "neutral": 0.18, "negative": 0.10 } }, "aspects": [ { "aspect": "sound quality", "label": "positive", "score": 0.91 }, { "aspect": "price", "label": "negative", "score": -0.34 } ], "summary": "Reviewers are overwhelmingly positive on sound quality and battery life, but frequently mention the price as too high." } } ``` *** ## 8. `keywords` — Keywords, Tags & Entities Extract ranked keywords, named entities, and suggested content tags. ```typescript Node.js SDK theme={null} const result = await client.webScrape({ url: 'https://example.com/blog/state-of-web-scraping-2026', aiPrompt: { type: 'keywords', maxKeywords: 10, includeEntities: true } }); ``` ```python Python SDK theme={null} result = client.web_scrape(WebScrapeDto( url='https://example.com/blog/state-of-web-scraping-2026', ai_prompt={'type': 'keywords', 'max_keywords': 10, 'include_entities': True} )) ``` ```bash cURL theme={null} curl -X POST https://api.geekflare.com/webscraping \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/blog/state-of-web-scraping-2026", "aiPrompt": {"type": "keywords", "maxKeywords": 10, "includeEntities": true} }' ``` | Field | Type | Required | Default | Description | | ----------------- | ------- | -------- | ------- | ------------------------------------------------------------------ | | `maxKeywords` | number | no | `10` | Maximum keywords to return (1–30) | | `includeEntities` | boolean | no | `false` | Also extract named entities (orgs, people, dates, laws, locations) | ```json theme={null} { "aiResult": { "type": "keywords", "answered": true, "keywords": [ { "term": "web scraping", "relevance": 0.97 }, { "term": "headless browser detection", "relevance": 0.84 } ], "entities": [ { "text": "GDPR", "type": "law" }, { "text": "Cloudflare", "type": "organization" } ], "suggestedTags": ["web-scraping", "ai", "data-extraction", "proxies", "compliance"] } } ``` `entities` is only included when `includeEntities` is `true`. *** ## Content Handling AI Extraction always uses the page's Markdown content — the same content you'd get from the `markdown` format — regardless of any `format` value you set. This keeps the model's input focused on primary content. ## Notes & Limits * Only one `aiPrompt` mode can be used per request. * Every mode answers strictly from the scraped page content — the model does not use outside knowledge and will not invent data that isn't present. * Page content is treated as untrusted data: instructions embedded in scraped pages are ignored. * Very long pages are truncated before analysis; if you're missing expected data from a long listing or product page, try narrowing the `url` to a more specific page. # Supported AI Models Source: https://docs.geekflare.com/ai/chat/available-models All Available AI Models in Geekflare Chat. [Geekflare Chat](http://geekflare.com/ai/chat/) gives you access to the world’s most powerful AI models from top providers in a single workspace. You don't need to manage multiple subscriptions; simply select the model that fits your task from the model dropdown. > 💡 **Important:** > Different models require different amounts of compute power. Models are categorized into tiers (Lite, Advanced, and Ultra), and will consume a different number of credits per message. > > Before chatting, please review our **[Understanding the Credit System](https://docs.geekflare.com/ai/chat/credit-system)** guide to see exactly how many credits your selected model will cost. The cost is also displayed in the model dropdown interface. ![Credit Info](https://cdn.geekflare.com/api-assets/chat-credit-info.png) ## OpenAI OpenAI provides industry-leading models for general conversation, reasoning, and specialized coding tasks. * GPT-5.5 * GPT-5 Nano * GPT-5 Mini * GPT-4.1 Nano * GPT-4.1 Mini * GPT-4o Mini * o4 Mini (Reasoning) * GPT-5.1 Codex Mini (Coding) * GPT-5.4 * GPT-5.3 Chat * GPT-5.3 Codex (Coding) * GPT-4.1 * GPT-4o * o3 (Reasoning) * GPT Image 1 * GPT Image 2 ## Google Gemini Google's Gemini ecosystem is highly optimized for speed, multimodal tasks (images), and wide context windows. * Gemini 3.5 Flash * Gemini 3.1 Pro * Gemini 3 Pro * Gemini 3 Pro Image (Naon Banana Pro) * Gemini 3.1 Flash Image (Nano Banana 2) * Gemini 3 Flash * Gemini 3.1 Flash Lite ## xAI Grok Grok models offer exceptionally fast processing and good for social media content. * Grok Build 0.1 * Grok 4.3 * Grok 4.20 (Reasoning) * Grok 4.20 (Non-Reasoning) * Grok 4 Fast (Non-Reasoning) * Grok Imagine Image ## Anthropic Claude Claude models are renowned for their nuanced writing, high emotional intelligence, and ability to handle massive documents without losing context. * Claude Opus 4.7 * Claude Opus 4.6 * Claude Sonnet 4.6 * Claude Haiku 4.5 ## Perplexity Sonar Perplexity models are optimized for search and retrieving up-to-date information. * Sonar Pro * Sonar Reasoning * Sonar ## Mistral Mistral provides highly efficient, open-weight-style models that are excellent for logic, formatting, and fast text generation. * Mistral Large 3 * Magistral Medium * Magistral Small * Ministral 14B ## MiniMax MiniMax builds powerful language models to help with everyday tasks, coding, and real-world problem solving. * MiniMax M3 * Minimax M2.7 * Minimax M2.5 ## Qwen Qwen AI models are built by Alibaba. They are for fast and good for general chat and coding. * Qwen 3.7 Plus * Qwen 3.7 Max * Qwen 3.6 Max * Qwen 3.5 Flash * Qwen 3.6 Plus ## Meta Llama Llama is a family of open AI models by Meta. It is built for flexible, high-performance chat, coding, and multimodal use cases. * Llama 4 Scout * Llama 4 Maverick ## Kimi Kimi by Moonshot AI is focused on long-context models that excel at reading, reasoning, and productivity tasks. * Kimi K2.6 * Kimi K2.5 ## DeepSeek Fast AI for coding, reasoning, and everyday tasks. Ideal when you want strong performance without high cost. * DeepSeek V4 Pro * DeepSeek V4 Flash * DeepSeek V4 3.2 *** ### 🔄 Switching Models Mid-Conversation You don't have to stick to one model! You can start a conversation with a fast model to brainstorm, and then switch to a reasoning model in the same chat to write code based on your brainstorm. # Copy and Export Chat Responses Source: https://docs.geekflare.com/ai/chat/copy-export Geekflare Chat provides multiple options to copy and export AI model responses. ### Copy Options Every chat response includes a copy icon to save the output to your clipboard. You can choose from three formats based on your needs: * **Copy as Markdown:** Copies the raw markdown syntax. This is ideal for pasting into code editors, GitHub, Notion, or other markdown-supported platforms. * **Copy as Text:** Copies plain text only. This strips away all rich text styling, links, and code block formatting. * **Copy with Formatting:** Copies the rich text exactly as it appears in the chat. This preserves bolding, lists, and links, making it perfect for pasting directly into emails or Google Docs. Chat Copy ### Export Options For detailed responses, Geekflare Chat enables direct file exports. The export menu appears conditionally only when an AI response exceeds 200 words. You can download the response in the following formats: * **PDF (.pdf):** Best for saving finalized documents to share with stakeholders. * **Word Document (.docx):** Best for continued editing, formatting, and team collaboration in Microsoft Word or Google Docs. * **Markdown (.md):** Best for saving technical documentation, code-heavy responses, or blog posts directly to your local file system. Chat Export # Chat Credit System Source: https://docs.geekflare.com/ai/chat/credit-system How credits are calculated in Geekflare Chat To make AI usage predictable, [Geekflare Chat](https://geekflare.com/ai/chat/) uses a Credit System instead of confusing token counts. Every time you send a message or generate an image, a specific number of credits is deducted from your monthly balance based on the model you are using. ## Credit Costs at a Glance Costs are calculated per request, which includes your prompt, the AI's response, and the context of the conversation. | Tier | Cost per Request | Description | | :------------------ | :--------------- | :------------------------------------------------------------ | | **Lite Models** | **1 Credit** | Fast, everyday models perfect for drafting and quick answers. | | **Advanced Models** | **15 Credits** | Leading models for coding and deep reasoning. | | **Ultra Models** | **60 Credits** | The most powerful models available. | | **Standard Images** | **20 Credits** | High-quality image generation for everyday use. | | **HD Images** | **80 Credits** | High-definition image generation. | | **Ultra Images** | **160 Credits** | Ultra-high-definition premium images. | ### Feature Add-ons If you use advanced workspace features during a chat, a small additional credit fee is applied to that request: * Knowledge Base (Chatting with files using Data Sources): +5 Credits per request ## Extended Context, Chat History, and File Attachments The standard credit costs listed above cover a base limit of up to **10,000 tokens** per request (roughly 40,000 characters, or 7,500 to 10,000 words). To give you high-quality answers, the AI needs context. Your total token count for a single request includes: 1. Your current message 2. Previous messages in the same conversation (Chat History) 3. Any files, documents, or images you attach directly to the chat 4. The AI's response **The Multiplier Effect** If your conversation gets very long or you attach large files, your request may exceed the 10,000 base token limit. When this happens, a multiplier is applied to the base cost of your chosen model. We calculate the multiplier using this formula: Multiplier = ⌈ Total Tokens / 10000 ⌉ **How File Attachments Work** * **Text & Data Files** (`.txt`, `.csv`, `.json`, `.py`, etc.): Tokens are calculated based on the text length. * **PDFs & Images:** Token usage is dynamic. Multi-page PDFs and high-resolution images require more tokens to process, which may trigger a multiplier. Tip: If you need to analyze a document without triggering high multipliers, add it to your Knowledge Base (RAG) in Data instead of attaching it directly. The Knowledge Base searches only the most relevant sections, keeping your token count low. ## View Models by Tier * **Google:** Gemini 3.1 Flash Lite * **OpenAI:** GPT 5 Nano, GPT 5 Mini, GPT 5.1 Codex Mini, GPT 4.1 Nano, GPT 4.1 Mini, GPT 4o Mini * **Mistral:** Mistral 14B, Mistral Magistral Small * **MiniMax:** Minimax M2.7, Minimax 2.5 * **Qwen:** Qwen 3.5 Flash * **Meta:** Llama 4 Scout, Llama 4 Maverick * **DeepSeek:** DeepSeek V4 Flash * **Anthropic:** Claude Haiku 4.5, Claude Sonnet 4.6 * **Google:** Gemini 3.5 Flash, Gemini 3.1 Pro, Gemini 3 Pro, Gemini 3 Flash * **OpenAI:** GPT 5.4, GPT 5.3 Chat, GPT 5.3 Codex, GPT 4.1, o4 Mini, o3, GPT 4o * **xAI:** Grok Build 0.1, Grok 4.3, Grok 4.20 * **Perplexity:** Sonar, Sonar Reasoning * **Mistral:** Mistral Large, Mistral Magistral Medium * **Qwen:** Qwen 3.7 Plus, Qwen 3.7 Max, Qwen 3.6 Max, Qwen 3.6 Plus * **Kimi:** Kimi K2.6, Kimi K2.5 * **DeepSeek:** DeepSeek V4 Pro * **MiniMax:** MiniMax M3 * **Anthropic:** Claude Opus 4.7, Claude Opus 4.6 * **OpenAI:** GPT 5.5 * **Perplexity:** Sonar Pro * **xAI:** Grok Imagine Image * **Google:** Gemini 3.1 Flash Image (Nano Banana 2) * **OpenAI:** GPT Image 2 * **xAI:** Grok Imagine Image Pro * **Google:** Gemini 3 Pro Image (Nano Banana Pro) * **OpenAI:** GPT Image 1 ## How Credits are Calculated (Examples) Here is how your credits are used in real-world scenarios: * **Scenario A (Standard Chat)**: Asking a Lite Model like GPT 5 Nano to write an email. (Under 10K tokens). * Cost: **1 Credit**. * **Scenario B (Advanced Task)**: Asking an Advanced Model like Claude Sonnet 4.6 to write a React component. (Under 10K tokens). * Cost: **15 Credits**. * **Scenario C (Long Chat History)**: You have been chatting with an Advanced Model for an hour. The accumulated chat history sent to the AI is now 25,000 tokens. The formula applies a 3x multiplier to the base 15-credit cost. * Cost: **45 Credits**. * **Scenario D (Large File Attachment)**: You attach a large 40,000-token file to a Lite Model (1 credit). The formula applies a 4x multiplier. * Cost: **4 Credits**. * **Scenario E (Knowledge Base)**: Asking a Lite Model to summarize a small PDF you uploaded to your Knowledge Base. * Cost: 1 (Lite Model) + 5 (Knowledge Base Add-on) = **6 Credits**. ## Tips to Reduce Credit Usage in Geekflare Chat If you want to stretch your monthly credits further, follow these best practices. **Start new chats frequently** Because the AI needs to remember what you discussed, every new message you send includes your previous chat history. In a long conversation, this accumulating history can push your total tokens past the 10,000 base limit, triggering a 2x, 3x, or higher multiplier. When you change topics or no longer need the AI to remember earlier messages, start a fresh chat. **Use Lite models for everyday tasks** Not every prompt requires the heavy reasoning of a premium model. Use Lite models for drafting emails, brainstorming, summarizing text, or answering general questions. Reserve Advanced and Ultra models for coding, deep analysis, and intricate logic. **Upload recurring files to your Knowledge Base** If you attach a large file directly in the chat window, its entire token weight is processed with every single message you send. If you plan to chat with a file multiple times, upload it to your Knowledge Base (Data) instead. **Combine multiple instructions into one prompt** Since credits are charged per request, sending three separate, short messages will cost three times as much as sending one. Batch your questions and instructions into a single prompt to minimize base request charges. # Understanding Memory and Context Source: https://docs.geekflare.com/ai/chat/memory-and-context How memory and context is managed in Geekflare Chat. When you interact with an AI model, it does not possess memory like a human does. To help the AI follow your conversation, Geekflare Chat forwards your recent chat history (context) to the LLM alongside your new prompt. How much the AI remembers depends entirely on **two factors**: the number of previous messages configured in your settings and the maximum context window supported by the LLM you are using. ## Default Memory Behavior To provide a good experience while optimizing your costs, Geekflare Chat sends the **previous 10 messages to the AI by default**. This gives the model enough background to understand ongoing topics without consuming excessive credits. ## Customizing Your Chat Memory You have full control over how much history is sent to the AI. By going to **Chat Settings**, you can adjust the context limit from 0 to up to 50 previous messages. Chat Memory Settings ## Credit Usage and the Long Context Notice Please be aware that increasing your context limit comes with a trade-off. Sending a higher number of previous messages requires the AI to process more data, which will trigger higher credit usage for every new message you send. If your active conversation exceeds 20,000 tokens, Geekflare Chat will display a **Long Context Notice** banner. This is a friendly alert to help you avoid unexpected credit consumption. You can learn more about how this works and how to manage your costs in our [Long Context Notice guide](https://docs.geekflare.com/ai/chat/what-is-long-context-notice). # Supported File Types in Geekflare Chat Source: https://docs.geekflare.com/ai/chat/supported-file-types Geekflare Chat allows you to attach a variety of files to chat with LLMs for analysis, data extraction, and visual processing. You can attach these files by dragging them into the chat input box or clicking the + icon. File Attachment ## List of Supported File Types ### Documents & Presentations * `.pdf` (Portable Document Format) * `.docx` (Microsoft Word) * `.pptx` (Microsoft PowerPoint) * `.txt` (Plain Text) * `.md` (Markdown) ### Spreadsheets & Data * `.xlsx` (Microsoft Excel) * `.csv` (Comma-Separated Values) ### Code & Configuration * `.json`, `.yaml`, `.yml`, `.ini` (Configuration) * `.html`, `.css` (HTML and CSS) * `.py`, `.js`, `.ts`, `.tsx` (Python, JavaScript, and TypeScript) ### Images & Visuals * `.jpg`, `.jpeg`, `.png`, `.webp` * `.svg` (Scalable Vector Graphics) ## Credit Usage for Attachments Attaching large files or multiple files increases the total token count of your prompt. If your total token count exceeds the base limit, a multiplier is applied to your request. For full details on how file sizes affect your credit balance, please refer to our [Chat Credit System](https://docs.geekflare.com/ai/chat/credit-system) documentation. # Understanding the Long Context Notice Source: https://docs.geekflare.com/ai/chat/what-is-long-context-notice The long context notice is a friendly alert that appears when your current conversation has become long. We show this banner to help you manage your account usage efficiently and avoid unexpected credit consumption. Long Context Warning ## Why is there an extra cost? AI models do not automatically remember past messages like a human does. Every time you send a new message in an ongoing chat, Geekflare Chat has to send your entire conversation history back to the AI so it understands the context. As your chat gets longer, the AI has to read and process significantly more text for every single reply. This requires more computing power, which increases the cost. ## How long context impact credits? Our standard credit usage is based on conversations up to 10,000 tokens (roughly 7,500 words). When your chat history stays under this limit, you only pay the standard base credit rate per message. Once your conversation grows beyond this 10,000-token threshold, each new message will consume additional credits to cover the extra processing power required by the AI to read the long chat history. ## How to manage and keep your credit usage low? * **Start a new chat:** The easiest way to save credits is to start a fresh chat whenever you change topics or no longer need the AI to remember the earlier messages. * **Keep conversations focused:** Try to limit single chat threads to a specific task. Once the task is complete, move on to a new chat. * **Reduce chat memory:** By default, we send previous 10 messages to LLM. You can further reduce to lower the overall context. Chat Memory Settings * **Enable Compact Context Mode:** If you need to keep the conversation going but want to save on costs, turn on Compact Context Mode under Chat Settings. This feature summarizes older messages for the AI to remember the core details of your conversation while reducing the credit usage. By keeping an eye on the Long Context Notice, you can take full control of your credit usage while still taking advantage of continuous conversations when you truly need them. # Getting API Keys for AI Models Source: https://docs.geekflare.com/ai/connect/getting-ai-api-keys This guide will walk you through the process of obtaining API keys from various popular AI model providers like OpenAI, Gemini, DeepSeek, Claude, xAI Grok, and Mistral. These keys are required when using the Geekflare Connect (BYOK) product to interact with AI models. ## Best Practices for API Key Management Before you start obtaining keys for AI models, here are some best practices you should follow for managing your API keys. * **Treat API Keys Like Passwords:** They grant access to your account and billable services. Keep them confidential and secure. Do not share publicly. * **Rotate Keys Regularly:** For enhanced security, consider regenerating your API keys periodically. * **Monitor Your API Usage:** Keep an eye on your API usage dashboards provided by the AI model provider. This helps you track costs, stay within quotas, and detect any unauthorized activity. * **Understand Pricing and Quotas:** Be aware of the pricing model, free tiers, rate limits, and usage quotas associated with each API to avoid unexpected charges or service disruptions. * **Revoke Unused or Compromised Keys:** If a key is no longer needed or you suspect it has been compromised, revoke or delete it immediately from the provider's dashboard. ## OpenAI API Key **If you don't have an OpenAI account yet:** * Go to [OpenAI Platform](https://platform.openai.com/) and click 'Sign up' to create a new account, or 'Log in' if you've already started the process. ![OpenAI](https://cdn.geekflare.com/ai-assets/openai-login.png) * After logging in, you might see a 'Get Started' button. Click it to proceed. ![OpenAI](https://cdn.geekflare.com/ai-assets/openai-get-started.png) * On the next page, click the ‘Create an API key’ button. ![OpenAI](https://cdn.geekflare.com/ai-assets/openai-create-api-key.png) * On the API keys page, click the ‘Create new secret key’ button, typically located on the top right. ![OpenAI](https://cdn.geekflare.com/ai-assets/openai-create-secret-key.png) * A dialog will appear. Give your API Key a descriptive name (e.g., "Geekflare Connect Integration") and then click ‘Create secret key’. ![OpenAI](https://cdn.geekflare.com/ai-assets/openai-secret-key.png) * Your new API Key (also referred to as a Secret Key) will be generated and displayed only once. Click the 'Copy' button to copy the key. Important: Store this key securely immediately. You will not be able to view it again after closing this window. ![OpenAI](https://cdn.geekflare.com/ai-assets/openai-save-key.png) **If you already have an OpenAI account:** * Go to the OpenAI Platform and log in to your account. * Once logged in, click on your personal icon (usually in the top right corner) and select 'View API keys' from the dropdown menu. > (Alternatively, you can often directly navigate to [https://platform.openai.com/api-keys](https://platform.openai.com/api-keys) after logging in.) * On the API keys page, click the ‘Create new secret key’ button, typically located on the top right. * Give your API Key a descriptive name (e.g., "Geekflare AI Integration") and then click ‘Create secret key'. * Your new API Key (Secret Key) will be generated and displayed only once. Click the 'Copy' button to copy it. Important: Store this key securely immediately. You will not be able to view it again after closing this window. **Video Tutorial**