Usage

Usage

Welcome to the Anvil API Usage page! This section outlines the different environments available to interact with the Cardano blockchain, utilizing Anvil’s infrastructure. Each environment caters to a specific stage of development, or type of deployment, so you can choose the one that aligns best with your goals.

Why Multiple Environments?

Cardano supports multiple network “environments,” each intended for different purposes. These environments allow you to test without risking native ADA, preview upcoming features, or run production-grade services on the live (Mainnet) network.

Anvil provides separate endpoints for each environment to seamlessly move from experimentation to production while keeping the same API methods.


Overview of Anvil Environments

Below is a list of our available endpoints and their corresponding Cardano environments, along with links to detailed documentation and interactive API reference (Swagger UI).

Available Endpoints

Environment
Endpoint

Mainnet

https://prod.api.ada-anvil.app/v2/services/

Preprod

https://preprod.api.ada-anvil.app/v2/services/

Preview

https://preview.api.ada-anvil.app/v2/services/

Staging (Not for public use)

https://staging.api.ada-anvil.app/v2/services/

Development (Not for public use)

https://dev.api.ada-anvil.app/v2/services/

Test (Not for public use)

https://test.api.ada-anvil.app/v2/services/

Private Cluster

Contact Us for details

Note: To access any of these endpoints, you must include your API Key in the request header. See the next page on Authentication for details on generating and using your API Key.

Environment
Cardano Documentation
OpenAPI (Swagger)

Staging (Not for public use)

-

Development (Not for public use)

-

Test (Not for public use)

-

Private Cluster

-

-


Choosing the Right Environment

  • Mainnet

    • Who It’s For: Production-ready dApps, applications handling real ADA or NFTs, and live user interactions.

    • Key Benefits: Fully decentralized, real economic value, backed by Cardano’s production network.

    • Potential Risks: Transactions have real financial implications and network fees.

  • Preprod

    • Who It’s For: Users testing smart contracts, token minting, or new features without risking actual ADA.

    • Key Benefits: Closely mimics Mainnet behavior, using test tokens (TestAda).

    • Ideal Use Cases: Finalizing a project’s functionality before going live.

  • Preview

    • Who It’s For: Developers who want to experiment with upcoming Cardano features.

    • Key Benefits: See how new Cardano protocol changes may impact your code.

    • Ideal Use Cases: Testing compatibility with future network updates.

  • Private Cluster

    • Who It’s For: Enterprise solutions requiring a dedicated environment, or specialized compliance needs.

    • Key Benefits: Customizable settings, enhanced privacy, and dedicated resources.

    • How to Access: Reach out to Anvil to discuss your specific requirements.

  • Development, Staging & Test (Internal)

    • Who It’s For: Anvil’s internal testing, staging, and QA processes.

    • Availability: Not publicly accessible—used for advanced in-house development.


Basic Workflow

  1. Identify Your Environment

  • Decide which environment best fits your stage of development or production. For example, use Preprod if you want to test a minting flow without using real ADA.

  1. Obtain an API Key

  • You will need a valid API Key to authenticate your requests. Follow the Authentication guide to learn how to get and use your key.

  1. Explore Documentation

  • OpenAPI (Swagger UI): Each environment has an interactive API reference where you can see available endpoints, required parameters, and example responses.

  • Cardano Environment Docs: Links to official Cardano documentation for deeper context on how each network operates.

  1. Send Your First Request

  • Using a tool like cURL, Postman, or a code snippet in your favorite language, include your API Key in the header.

Construct your request based on the environment endpoint. For example:

curl -X GET \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY_HERE" \
  https://preprod.api.ada-anvil.app/v2/services/health

Expect a JSON response confirming the environment is up and running.

  1. Iterate and Expand Once you’re comfortable with a basic request, move on to minting, staking, or any other advanced functionality your project requires. Test thoroughly in Preprod or Preview before going live on Mainnet.


Next Steps

  1. Learn About Authentication

  • Proceed to our Authentication page for instructions on API Keys, request headers, and security best practices.

  1. Dive Into Deeper Guides

  • Check out the detailed guides (e.g., Minting, Transactions, UTXO vs. Change Address) in the sidebar to build more complex operations on Cardano.

  1. Join the Community

  • If you have questions or want to share feedback, our developer community is here to help. You’ll find links to support channels, forums, or contact forms in the Support section.


Common Pitfalls and Tips

  • Forgetting Your API Key

    • Always confirm the x-api-key header is included, or your request will fail with an authorization error.

  • Mixing Environments

    • Make sure you’re pointing to the correct environment. Production calls to Mainnet should not mix references to test tokens from Preprod or Preview.

  • Swagger UI

    • You can try out endpoints directly in the browser using the Swagger interface. It’s a quick way to familiarize yourself with available methods and parameters.

  • Documentation Is Your Friend

    • If something seems unclear, consult Cardano’s official docs or the guides in the sidebar. Each environment functions similarly, but their token usage and network IDs differ.

Last updated

Was this helpful?