# Quickstart with Our Gateway

{% hint style="danger" %}
**Warning:** This guide is designed for discovery and testing. For production, follow the hardening and credential delegation guides in [Configure External or Delegated Credentials for Cloud Storage](/guides/configure-external-delegated-credentials.md).
{% endhint %}

{% hint style="info" %}
This quickstart focuses on AWS-first examples for both **Cloud Storage** and **AI LLM** workflows. You can adapt the same setup pattern to other compatible providers supported by Flashback.
{% endhint %}

Use these two micro tutorials:

* [Start Quickly with Cloud Storage](#start-quickly-with-cloud-storage)
* [Start Quickly with AI LLM](#start-quickly-with-ai-llm)

***

## Start Quickly with Cloud Storage

Follow this flow to upload your first object through Flashback.

**Prerequisites**

* Python 3.9+
* `boto3` installed
* A Flashback workspace with access to **Storage**, **Repositories**, and **API Keys**
* An AWS S3 bucket you can connect (direct credentials or delegated access)

{% stepper %}
{% step %}

#### Sign in

Sign in at [platform.flashback.tech](https://platform.flashback.tech/) with your account.

{% hint style="info" %}
If you do not have an account yet, you can [request a demo](https://platform.flashback.tech/).
{% endhint %}
{% endstep %}

{% step %}

#### Configure your first bucket

You can use delegated access (recommended) or direct credentials for a quick test.

* Go to **Storage** → **Buckets**.
* Click **Add Bucket**.
* Fill in the bucket form:
  * **Name:** `My First Bucket`
  * **Storage Type:** `S3`
  * **Bucket:** your exact AWS S3 bucket name
  * **Access Key / Secret Key:** AWS access key pair (or delegated role info)
  * **Endpoint:** leave empty for AWS, or set custom S3 endpoint
  * **Region:** required when endpoint is empty
* Click **Create**.

{% hint style="info" %}
Detailed guide: [Configure a Bucket](/guides/setup-the-cloud-and-ai-gateway/start-with-cloud-storage/create-a-bucket.md).
{% endhint %}
{% endstep %}

{% step %}

#### Create a repository

* Go to **Repositories**.
* Click **Add Repository**.
* Fill:
  * **Name:** `my-first-s3-repository`
  * **API Type:** `S3`
* In **Storage Buckets**, attach `My First Bucket`.
* Click **Create**.

{% hint style="info" %}
Detailed guide: [Create a Repository](/guides/setup-the-cloud-and-ai-gateway/start-with-cloud-storage-1/create-a-repository.md).
{% endhint %}
{% endstep %}

{% step %}

#### Generate an API key

In your repository:

* Open **Inventory** in **Repositories.** Choose your newly created repository.
* Look for the API Key Table,and Click **Add,** and select Buckets.
* Set a label such as `quickstart-write`.
* Choose access mode **WRITE**/**READ/ADMIN (read+write)**.
* Copy the secret immediately (it is shown once).
  {% endstep %}

{% step %}

#### Run storage snippets (reviewed)

Install dependency:

```bash
pip install boto3
```

Create a shared config file:

```python
# flashback_s3_config.py
import os
import boto3
from botocore.client import Config

FLASHBACK_S3_ENDPOINT = os.environ["FLASHBACK_S3_ENDPOINT"]
FLASHBACK_S3_KEY_ID = os.environ["FLASHBACK_S3_KEY_ID"]
FLASHBACK_S3_SECRET = os.environ["FLASHBACK_S3_SECRET"]

session = boto3.session.Session(
    aws_access_key_id=FLASHBACK_S3_KEY_ID,
    aws_secret_access_key=FLASHBACK_S3_SECRET,
)

s3_client = session.client(
    service_name="s3",
    endpoint_url=FLASHBACK_S3_ENDPOINT,
    config=Config(signature_version="s3v4"),
)
```

List buckets exposed by your repository:

```python
# list_buckets.py
from flashback_s3_config import s3_client

response = s3_client.list_buckets()
print("Buckets available through Flashback:")
for bucket in response.get("Buckets", []):
    print(f" - {bucket['Name']}")
```

Upload a file:

```python
# upload_file.py
import os
from pathlib import Path
from flashback_s3_config import s3_client

bucket_name = os.environ["FLASHBACK_BUCKET_NAME"]
file_path = Path(os.environ["LOCAL_FILE_PATH"])
object_key = file_path.name

s3_client.upload_file(
    Filename=str(file_path),
    Bucket=bucket_name,
    Key=object_key,
)

print(f"Uploaded '{object_key}' to bucket '{bucket_name}'.")
```

Example environment variables:

```bash
export FLASHBACK_S3_ENDPOINT="https://s3-us-east-1.aws.flashback.tech"
export FLASHBACK_S3_KEY_ID="<your-repository-api-key-id>"
export FLASHBACK_S3_SECRET="<your-repository-api-secret>"
export FLASHBACK_BUCKET_NAME="<bucket-attached-to-repository>"
export LOCAL_FILE_PATH="./sample.txt"
```

{% endstep %}
{% endstepper %}

***

## Start Quickly with AI LLM

This quickstart shows an AWS-oriented AI setup with Flashback acting as the unified gateway.

**Prerequisites**

* Python 3.9+
* `openai` SDK installed
* A Flashback workspace with access to **AI LLM**, **Repositories**, and **API Keys**
* AWS model access enabled in your account (for example via Amazon Bedrock)

{% stepper %}
{% step %}

#### Add an AI LLM provider (AWS)

* Go to **AI** → **AI LLM**.
* Click **Add AI LLM**.
* Select **AI LLM Type: AWS**.
* Fill:
  * **Configuration Name:** `aws-llm-primary`
  * **API Endpoint:** your AWS-compatible endpoint used by Flashback
  * **API Secret:** credential/token used by that endpoint
  * **API Key:** fill only if your endpoint requires it
* Click **Create configuration**.

{% hint style="info" %}
Detailed guide: [Configure an AI LLM](/guides/setup-the-cloud-and-ai-gateway/start-with-cloud-storage/create-a-bucket-1.md).
{% endhint %}
{% endstep %}

{% step %}

#### Create an AI repository

* Go to **Repositories** → **Add Repository**.
* Set:
  * **Name:** `my-first-ai-repository`
  * **API Type:** `AI`
* In provider/resource selection, attach `aws-llm-primary`.
* Save the repository.
  {% endstep %}

{% step %}

#### Generate an AI API key

In the AI repository:

* Open **Inventory** in **Repositories.** Choose your newly created repository.
* Look for the API Key Table,and Click **Add,** and select AI LLMs.
* Set a label such as `quickstart-write`.
* Copy and store the secret immediately.
  {% endstep %}

{% step %}

#### Run AI snippets (reviewed)

Install dependency:

```bash
pip install openai
```

Call the repository endpoint with the OpenAI-compatible SDK:

```python
# ai_prompt.py
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["FLASHBACK_AI_API_KEY"],
    base_url=os.environ["FLASHBACK_AI_BASE_URL"],
)

response = client.chat.completions.create(
    model=os.environ.get("FLASHBACK_AI_MODEL", "anthropic.claude-3-5-sonnet"),
    messages=[
        {"role": "system", "content": "You are a concise cloud assistant."},
        {"role": "user", "content": "Summarize the value of a unified AI gateway in 3 bullets."},
    ],
    temperature=0.2,
)

print(response.choices[0].message.content)
```

Example environment variables:

```bash
export FLASHBACK_AI_BASE_URL="https://api.flashback.tech/ai/openai"
export FLASHBACK_AI_API_KEY="<your-ai-repository-api-key>"
export FLASHBACK_AI_MODEL="anthropic.claude-3-5-sonnet"
```

{% hint style="warning" %}
Model identifiers depend on what your AWS-backed configuration exposes through Flashback. If a model is rejected, list or validate available models in your workspace and update `FLASHBACK_AI_MODEL`.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flashback.tech/getting-started/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
