How to Use Baselayer with LLMs

How to Use Baselayer with AI Assistants

AI assistants can significantly accelerate your Baselayer integration. By loading Baselayer's documentation index into your session, the model can generate accurate code, explain API responses, and guide you through implementation - without you needing to manually search through reference pages.

This guide shows you how to set up your AI assistant correctly and provides copy-paste prompts for every major Baselayer product.


Before You Start

Complete both steps before using any prompt below.

Step 1: Know your API key

The only difference between the sandbox and production environments is your API key. Both keys are available in the Baselayer console. Use your sandbox key while building and testing, and switch to your production key when you're ready to go live. See Sandbox vs. Production Environments for a full breakdown.

Step 2: Load Baselayer's documentation into your AI session

Baselayer provides a documentation index optimized for AI assistants at:

https://docs.baselayer.com/llms.txt

This file maps Baselayer's complete documentation - every guide, API reference, and webhook - as direct links to clean markdown files. Loading this index gives the AI accurate knowledge of Baselayer's endpoints, field names, and async patterns. Without it, the model will generate generic API code that is likely to be incorrect.

To load it, start every new session with this instruction:

"Please fetch and read https://docs.baselayer.com/llms.txt before we begin. Once you've read it, confirm and wait for my next message."

Wait for the model to confirm it has read the file before pasting any prompt below. If your AI assistant does not have web browsing enabled, visit the URL yourself, copy the full contents, and paste them at the top of your session instead.


How to Use These Prompts

Each prompt below is designed to be copied and pasted directly into your AI session after completing the steps above. Because the model has already loaded the documentation index, the prompts reference guide titles alongside their markdown source files - this gives the model precise context without relying on rendered web pages.

The prompts are grouped into two phases:

  • Building Your Integration: Prompts 1–7 cover each major Baselayer product
  • Testing and Edge Cases: Prompts 8–9 cover sandbox setup and operational scenarios you will encounter before going to production

Building Your Integration

1. Business Search

Start here if you are new to Baselayer or building your core KYB workflow.

I'm working on a Baselayer integration and want to set up Business Search.

Please reference the following guides from the documentation index you already loaded:
- Business Verification Basics: https://docs.baselayer.com/docs/business-verification-basics.md
- Business Search: Basics: https://docs.baselayer.com/docs/business-search-basics.md
- Business Search: API Quickstart: https://docs.baselayer.com/docs/business-search-api-quickstart.md
- POST /searches: https://docs.baselayer.com/reference/post_search_searches_post-1.md
- GET /searches/{id}: https://docs.baselayer.com/reference/get_search_searches__id__get-1.md

Help me:
1. Build a complete Business Search request body
2. Explain required vs. optional fields
3. Provide a working code example
4. Explain how to retrieve and interpret results
5. Suggest error handling and retry strategies

2. Web Presence

Use this when you need to verify a business's online presence, find its website, or predict its industry.

I'm working on a Baselayer integration and want to set up Web Presence.

Please reference the following guides from the documentation index you already loaded:
- Online Presence: Basics: https://docs.baselayer.com/docs/online-presence-basics.md
- Online Presence & Orderables: Best Practices: https://docs.baselayer.com/docs/web-presence-orderables.md
- Sole Proprietorship Verification: https://docs.baselayer.com/docs/sole-prop-verification.md
- POST /web_presence_requests: https://docs.baselayer.com/reference/post_web_presence_request_web_presence_requests_post-1.md
- GET /web_presence_requests/{id}: https://docs.baselayer.com/reference/get_web_presence_request_web_presence_requests__id__get-1.md

Help me:
1. Create a complete Web Presence request
2. Explain available enrichment options
3. Show an example response and explain the key fields
4. Explain how to check job status and retrieve results
5. Suggest production best practices

3. Lien Search

Use this if you are building a lending or credit product and need to check for existing liens or judgments.

I'm working on a Baselayer integration and want to add Lien Search.

Please reference the following guides from the documentation index you already loaded:
- Liens, Judgments, and Public Records: https://docs.baselayer.com/docs/liens-judgments-and-public-records.md
- Lien Search: Best Practices: https://docs.baselayer.com/docs/lien-search-best-practices.md
- POST /lien_searches: https://docs.baselayer.com/reference/start_liens_search_lien_searches_post-1.md
- GET /lien_searches/{id}: https://docs.baselayer.com/reference/get_liens_lien_searches__liens_search_request_id__get-1.md

Help me:
1. Build a complete Lien Search request
2. Explain filtering options and search_states options
3. Provide a working code example
4. Explain how to retrieve and interpret results
5. Suggest error handling strategies

4. Litigation and Docket Search

Use this to check for active or historical litigation and bankruptcy filings.

I'm working on a Baselayer integration and want to add Litigation and Docket Search.

Please reference the following guides from the documentation index you already loaded:
- Litigation and Bankruptcy Records: https://docs.baselayer.com/docs/litigation-and-bankruptcy-records.md
- Litigation & Bankruptcy Search: Best Practices: https://docs.baselayer.com/docs/litigation-bankruptcy-search-best-practices.md
- POST /docket_searches: https://docs.baselayer.com/reference/start_docket_search_docket_searches_post-1.md
- GET /docket_searches/{id}: https://docs.baselayer.com/reference/get_all_dockets_by_search_request_id_docket_searches__search_request_id__get-1.md
- PUT /dockets/{docket_id}/details:
https://docs.baselayer.com/reference/order_docket_details_dockets__docket_id__details_put-1.md

Help me:
1. Submit a docket search request
2. Explain filtering options
3. Provide a working code example
4. Explain how to retrieve and interpret results
5. Explain how to retrieve detailed docket information

5. Business Pre-Fill

Use this if you are building your initial onboarding flow and want to auto-complete business information for applicants.

I'm building an onboarding flow and want to use Baselayer Business Pre-Fill to auto-complete business information for applicants.

Please reference the following guides from the documentation index you already loaded:
- Business Pre-Fill: Basics: https://docs.baselayer.com/docs/business-prefill-basics.md
- Business Pre-Fill: API Quickstart: https://docs.baselayer.com/docs/business-prefill-api-quickstart.md
- Business Pre-Fill: Best Practices: https://docs.baselayer.com/docs/business-prefill-best-practices.md
- GET /prefill/businesses: https://docs.baselayer.com/reference/business_prefill_prefill_businesses_get-1.md

Help me:
1. Build a Pre-Fill request
2. Explain what data is returned
3. Show a full example response
4. Explain how to integrate this into an onboarding flow
5. Suggest UX and validation best practices

6. Webhooks

Set this up alongside any other product - webhooks are how Baselayer notifies you when async jobs complete.

I'm integrating Baselayer and want to set up webhooks for real-time event notifications.

Please reference the following guides from the documentation index you already loaded:
- Authentication: https://docs.baselayer.com/docs/authentication.md
- Webhooks at Baselayer: https://docs.baselayer.com/docs/webhooks-at-baselayer.md
- POST /webhooks: https://docs.baselayer.com/reference/create_webhook_endpoint_webhooks_post-1.md
- Webhook Event — Business Search Completed: https://docs.baselayer.com/reference/webhook_handlerbusinesssearch_completed_post-1.md

Help me:
1. Register a webhook endpoint
2. Verify webhook signatures
3. Handle the most common webhook events
4. Implement retry handling
5. Provide a working Python or Node.js example

7. Portfolio Monitoring

Use this once your core KYB workflow is in place and you need ongoing monitoring for businesses in your portfolio.

I'm working on a Baselayer integration and want to set up Portfolio Monitoring.

Please reference the following guides from the documentation index you already loaded:
- Portfolio Monitoring: Basics: https://docs.baselayer.com/docs/portfolio-monitoring-basics.md
- Portfolio Monitoring: API Quickstart: https://docs.baselayer.com/docs/portfolio-monitoring-api-quickstart.md
- Portfolio Monitoring: Best Practices: https://docs.baselayer.com/docs/portfolio-monitoring-best-practices.md
- POST /portfolio_items: https://docs.baselayer.com/reference/create_portfolio_item_portfolio_items_post-1.md

Help me:
1. Create a portfolio item
2. Explain what data is monitored
3. Show a full request and response example
4. Explain how to handle monitoring alerts and events
5. Suggest production best practices

Testing and Edge Cases

8. Set Up and Test in Sandbox

Complete this before writing integration code. Your sandbox API key is available in the Baselayer console and gives you a safe environment to validate requests before switching to your production key.

I'm building a Baselayer integration and want to test it safely before going to production.

Please reference the following guides from the documentation index you already loaded:
- Sandbox vs. Production Environments: https://docs.baselayer.com/docs/sandbox-vs-production-environments.md
- Authentication: https://docs.baselayer.com/docs/authentication.md
- Getting Started with Baselayer API: https://docs.baselayer.com/docs/getting-started-with-baselayer-api.md

Help me:
1. Understand the key differences between sandbox and production
2. Configure authentication correctly for the sandbox environment
3. Run a test Business Search request in sandbox
4. Explain what test data is available and how to use it
5. Explain how to safely transition from sandbox to production

9. Handle an IRS Pending Response

Use this if your Business Search is returning a pending IRS state and you are not sure how to handle it.

I'm integrating Baselayer and need to understand how to handle IRS pending responses during a Business Search.

Please reference the following guides from the documentation index you already loaded:
- Guide: IRS Outage Handling: https://docs.baselayer.com/docs/guide-irs-outage-handling.md
- Business Search: Basics: https://docs.baselayer.com/docs/business-search-basics.md
- Webhooks at Baselayer: https://docs.baselayer.com/docs/webhooks-at-baselayer.md

Help me:
1. Understand what an IRS pending response means
2. Detect and handle this state in my integration
3. Use webhooks to be notified when the IRS response resolves
4. Implement retry logic and fallback strategies
5. Understand how this state affects my overall Business Search flow

Tips for Better Results

Specify your language and libraries. After pasting a prompt, add a line like "Use Python with the httpx library" or "Use Node.js with axios." The AI will tailor all code examples accordingly.

Ask follow-up questions. These prompts are starting points. If a response references a field or state you don't recognize, ask: "What does a state of PENDING mean and how should I handle it in my workflow?"

Verify field names against the API reference. AI assistants can occasionally produce incorrect field names. If a generated request body doesn't match what you see in the Baselayer API reference, ask the model to re-read the relevant endpoint file and correct its answer.

Start a new session for each product. Context windows have limits. If you are moving from one product to another, start a fresh session, reload llms.txt, and use the appropriate prompt.