For the complete documentation index, see llms.txt. This page is also available as Markdown.

Importing an API Source

Import an OpenAPI spec to create an API Source

To create an API store, you first connect your APIs to API.market. When a user calls API.market, the platform calls your API using the API Source you define and its configuration.

🎯 Overview

The API Source is the OpenAPI specification that connects your APIs to API.market. API.market acts as an API gateway, making your API available through a unified platform.

πŸ’‘ How it works: API.market proxies requests to your API using the OpenAPI specification. This lets API.market handle authentication, billing, analytics, and rate limiting automatically.

πŸ“‹ Prerequisites

Before you begin, you will need:

βœ… An OpenAPI specification file (YAML or JSON) βœ… Your API's base URL βœ… Authentication details (if required)

πŸš€ Step-by-step guide

Step 1 β€” Open "OpenAPI Specs"

Go to the Seller Console and select your organization from the dropdown. Then click "Manage APIs" in the left sidebar and select "OpenAPI Specs".


Step 2 β€” Import the OpenAPI YAML or JSON file

Upload or drag and drop your OpenAPI specification file. You should see the paths imported from the file.

Step 3 β€” Configure custom headers

Next, add any custom headers that should be included in every API request to your backend.

  1. Enter a JSON object in the text area.

  2. Format: {"Header-Name": "header-value"}

  3. Example:

πŸ’‘ No custom headers? Leave this as {} (an empty JSON object) and continue.

Step 4 β€” Configure base path URL

Set the base URL for all API requests. This is the root address API.market will call.

  1. The field may be pre-filled if a servers entry was detected in your OpenAPI spec.

  2. Review or enter your API's base URL.

  3. Format: https://api.example.com/v1

  4. This URL is used as the base for every API request.

Example:

Step 5 β€” Configure authentication

Choose how API.market authenticates with your backend when it forwards a request. You have five options.

Option 1 β€” No authentication

  • Select the "None" tab.

  • No authentication is used when making API requests.

Option 2 β€” API Key

  • Select the "API Key" tab.

  • Enter the Header Name (e.g. X-API-Key, Authorization).

  • Enter the API Key Value (masked for security).

  • The API key is sent in the specified header with each request.

Example β€” Header Name: X-API-Key Β· API Key Value: your-secret-api-key

Option 3 β€” Bearer Token

  • Select the "Bearer Token" tab.

  • Enter your bearer token (masked for security).

  • The token is sent in the Authorization header as Bearer <token>.

Example β€” Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Option 4 β€” Basic Auth

  • Select the "Basic Auth" tab.

  • Enter your Username and Password (masked for security).

  • Credentials are base64 encoded and sent in the Authorization header.

Example β€” Username: myuser Β· Password: mypassword

Option 5 β€” Query Parameter

  • Select the "Query Param" tab.

  • Enter the Parameter Key (e.g. api_key, token).

  • Enter the Parameter Value (masked for security).

  • The parameter is added to the query string of each request.

Example β€” Param Key: api_key Β· Param Value: your-api-key-value

Step 6 β€” Review summary and create

Review all your configuration before creating the API Source. The summary shows:

  • API Source Name β€” the detected or entered name

  • API Version β€” the detected version

  • Base URL β€” the configured base URL

  • Custom Headers β€” the JSON object of custom headers

  • Authentication β€” the selected method and configuration

  • Endpoints β€” the list of all detected endpoints

Review checklist:

  • βœ… API name and version are correct

  • βœ… Base URL is correct

  • βœ… Custom headers are properly formatted

  • βœ… Authentication is configured correctly

  • βœ… All expected endpoints are listed

Then click "Create API Source". Your API Source is created and you are taken back to the API Sources list, where you should see it appear.


βœ… What's next?

After importing your API Source, you can:

  1. Create products β€” use your API Source to create API products

  2. Configure pricing plans β€” set up pricing for your endpoints

  3. Test your APIs β€” use the API Playground to test your endpoints

  4. View analytics β€” monitor usage and performance


πŸ› οΈ Troubleshooting

"No endpoints found" Check that your OpenAPI spec has a paths object with at least one endpoint defined.

"Invalid JSON/YAML" Validate your OpenAPI spec with an online tool such as Swagger Editor.

"Base URL not detected" Make sure your spec includes a servers array with at least one URL, or enter it manually in Step 5.

"Authentication not working" Verify your credentials are correct, check that the header name matches what your API expects, and confirm the authentication type matches your API's requirements.


πŸ’‘ Best practices

  1. Validate your OpenAPI spec β€” use tools like Swagger Editor before importing.

  2. Test authentication β€” after creating your source, test it with a sample request.

  3. Use descriptive names β€” pick clear API Source names you can identify later.

  4. Document custom headers β€” keep track of what headers you use and why.

  5. Version your APIs β€” use semantic versioning (e.g. 1.0.0, 2.1.3).


Next β†’ What Is an API Product

Last updated