TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Grain – “ChatGPT for your docs” API

3 pointsby abiabout 2 years ago
Hi HN,<p>We’ve built an API that allows developers to easily add &quot;ChatGPT for your docs&quot;-like features into your app to query&#x2F;chat with your own or your users’ knowledge base.<p>You upload a PDF (or multiple) with 1 simple API call, and then chat with that PDF with another API call.<p>We handle securely storing documents, creating semantic embeddings, ensuring accurate responses, and maintaining high performance and reliability so that you can focus on everything else.<p>Here&#x27;s an example where we upload our super long &quot;Company Bylaws&quot; PDF and then, ask the document &quot;Where do the shareholders meet?&quot;:<p><i>Upload</i><p>&gt; curl -X POST -H &quot;Authorization: Bearer API_KEY&quot; -F &quot;file=@.&#x2F;company-bylaws.pdf&quot; <a href="https:&#x2F;&#x2F;api.usegrain.co&#x2F;v1&#x2F;documents&#x2F;upload" rel="nofollow">https:&#x2F;&#x2F;api.usegrain.co&#x2F;v1&#x2F;documents&#x2F;upload</a><p>&gt; {&quot;status&quot;:&quot;success&quot;,&quot;collection_id&quot;:&quot;ad8b106a-7739-4798-8a58-3d66cdfd6183&quot;,&quot;filename&quot;:&quot;company-bylaws.pdf&quot;}<p><i>Query</i><p>&gt; curl -X POST -H &quot;Authorization: Bearer API_KEY&quot; -H &quot;Content-Type: application&#x2F;json&quot; -d &#x27;{&quot;query&quot;: &quot;Where do the shareholders meet?&quot;, &quot;include_sources&quot;: false}&#x27; <a href="http:&#x2F;&#x2F;api.usegrain.co&#x2F;v1&#x2F;collections&#x2F;ad8b106a-7739-4798-8a58-3d66cdfd6183&#x2F;query" rel="nofollow">http:&#x2F;&#x2F;api.usegrain.co&#x2F;v1&#x2F;collections&#x2F;ad8b106a-7739-4798-8a5...</a><p>&gt; {&quot;result&quot;:&quot;The meeting of shareholders can be held at any place designated by the Board of Directors, or at the registered office of the corporation if no other place is designated. It can be held within or outside the state of Delaware.&quot;} It’s free for now for early users. We’re aiming to get feedback so that we can continue to improve the API and make it even more useful.<p>To ensure accuracy, you can also get a list of sources highlighting the parts of the source document(s) that were used to generate the answer.<p>It’s free to try: <a href="https:&#x2F;&#x2F;www.usegrain.co&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.usegrain.co&#x2F;</a> Would love to hear your feedback and use cases!

no comments

no comments