LIVE DEMO · FRAMER COMPONENT

Turn “Get Started” into a first API call

Turn “Get Started” into a first API call

Turn “Get Started” into a first API call

Switch between three example APIs below. Pick a language, framework, and package manager, and every command and code sample rewrites itself for that stack.

Switch between three example APIs below. Pick a language, framework, and package manager, and every command and code sample rewrites itself for that stack.

AI API quickstartMake your first API call in two minutesPick your stack. Every command and code sample below adapts to it.
0 of 4 steps done
Language
Framework
Installer
  1. Install the SDKAdd the Acme library to your project.
    Terminal
    npm install @acme/sdk
  2. Add your API keyKeep secrets out of your code with an env file.
    .env
    ACME_API_KEY=sk_test_your_key_here
  3. Make your first requestCreate this file in your project.
    index.mjs
    import Acme from "@acme/sdk";
    
    const client = new Acme({ apiKey: process.env.ACME_API_KEY });
    
    const res = await client.messages.create({
      model: "acme-1",
      input: "Hello, world",
      max_tokens: 64,
    });
    
    console.log(res.output);
  4. Run itYou should see a response like the one below.
    Terminal
    node --env-file=.env index.mjs
    200 OK142 msResponse
    {
      "id": "msg_01HZX8K2",
      "model": "acme-1",
      "output": "Hello! How can I help you today?",
      "usage": {
        "input_tokens": 4,
        "output_tokens": 9
      }
    }

Get the SDK Quickstart Builder

$129 one-time. Unlimited license for unlimited sites and client projects. Includes the component source and the setup guide.

Create a free website with Framer, the website builder loved by startups, designers and agencies.