# Share an API key or a 1Password link with one person

> Walkthrough: put a secret in one file, publish it privately with qURL, invite the one person by email or send a single-use link, then delete it all.

Source: https://layerv.ai/guides/share-an-api-key-securely/

---

[← All guides](https://layerv.ai/guides/) 

# Share an API key or a 1Password link with one person

## Why qURL here

The secret stays in a file on your computer and opens only for the person you invited, after they verify their email and save a passkey, so it never sits in a chat, an inbox or a pasted note. You delete the resource and the file when it has arrived, and nothing is left to find.

Copies a prompt for any agent that runs commands. 

Read https://layerv.ai/skills/qurl/SKILL.md and follow it.
Also read references/access-policies.md beside it.
I saved a secret in ~/one-secret/secret.txt. Do not read or print it.
Serve that folder on 127.0.0.1:8765.
Publish it invite-only with the public name "Shared note", and do not open it in a browser.
Check that the reply says private: true with the invite-only policy.
Check that qurl status reports connection_state "serving".
Invite ana@example.com, and nobody else.
When I say it arrived, delete the resource and stop the server.
Then remove the ~/one-secret folder.

## What you need

- The qURL CLI 4.0.0 or later
- Python 3, for a static file server on 127.0.0.1
- The email address of the person who should get the secret, or a direct-message channel to them for a single-use link
- A private window, to check the address as a stranger

Content updated November 11, 2026.

## Steps

Save the secret in its own file, serve that folder on 127.0.0.1, and publish it invite-only with qURL™ under a neutral name. Invite the person by email: they verify that address and save a passkey before they can open the file, so a forwarded email gets nobody else in. No email address? Publish without invite-only and send one single-use link. When they have it, delete the resource, stop the server and remove the file.

1. ### Install the qURL CLI  
On macOS, install it with Homebrew. On Linux and Windows, download the package for your platform from the latest release; the CLI page lists each one. Nothing asks you to sign up.  
```  
brew install layervai/tap/qurl
qurl --version
```

**Check:** qurl --version prints 4.0.0 or later. If it is older, update the CLI before you go on.
2. ### Put the secret in a folder of its own  
Copy the API key, the password or the 1Password share link to your clipboard first. On a Mac, pbpaste writes it to the file without it appearing in your terminal or its history; elsewhere, save the file with a text editor. The server lists everything in this folder, so keep it to this one file.  
```  
mkdir -m 700 ~/one-secret && cd ~/one-secret
pbpaste > secret.txt
ls
```

**Check:** The listing shows secret.txt and nothing else.
3. ### Serve the folder on 127.0.0.1  
Run this in the folder and keep it running in its own terminal. It listens only on this machine: qURL connects to it there, so nothing opens on your network.  
```  
python3 -m http.server 8765 --bind 127.0.0.1
```

**Check:** In a second terminal, curl --fail -o /dev/null http://127.0.0.1:8765/secret.txt exits without an error.
4. ### Publish it invite-only, with a neutral name  
Invite-only means only the email addresses you invite can open it, and nobody else can ask. The name is public text, so it must never describe the secret. No email address for the person? Skip to the single-use link below instead.  
```  
qurl publish http://127.0.0.1:8765 \
  --access invite_only --name "Shared note" -o json
```

**Check:** The reply says private: true and its consumer\_access names the invite-only policy. Save the CRID it prints.
5. ### Confirm it is serving  
A successful publish does not prove the route is up. Read the resource’s status before you invite anyone.  
```  
qurl status <CRID> -o json
```

**Check:** connection\_state is "serving". For any other state, run qurl inspect <CRID> -o json to see why.
6. ### Check the address as a stranger  
Open https://qurl.link/<CRID> in a private window, with your CRID in place of <CRID>.

**Check:** You see the name “Shared note” and “This is invite-only”, with no way to ask for access and no file.
7. ### Invite the one person  
Use the email address they will check today. They open the emailed invitation, verify their email and save a passkey, then open secret.txt and copy the secret. Their email verification code stays in that browser; they never send it to you. Tell them in a direct message to expect the email.  
```  
qurl access invite <CRID> --email ana@example.com -o json
```

**Check:** The reply shows the invitation with status open and delivery accepted. Accepted means the email was sent, not that they have opened it: ask them to tell you once they have copied the secret.
8. ### Received? Delete everything  
Delete the resource, stop the server with Ctrl-C in its terminal, and remove the folder. Deleting the resource also ends the invitation.  
```  
qurl delete <CRID> --yes
rm -r ~/one-secret
```

**Check:** A later qurl status <CRID> answers “Resource Revoked”, and \~/one-secret no longer exists.

## What the recipient sees

With an invitation, the person opens the email in a browser, verifies their address and saves a passkey, then sees a list with one file, secret.txt.

They open it and copy the secret. With a single-use link, they open the link and see the same one-file list; opening it again shows “Access link invalid”. Nothing to install and no account to create either way.

## No email address? Send a single-use link instead

A single-use link needs nothing from the person, but whoever opens it first gets the secret. Use it when you don’t have their email, and send it only in a direct message. Steps 1 to 3 stay the same; these replace steps 4 to 7.

__No email address? Send a single-use link instead__
| Step                 | What to do                                                                                                                                                                                                                                                                                                  |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Publish it privately | qurl publish http://127.0.0.1:8765 --name "Shared note" -o json. Leave out --access: an invite-only resource gives no links. Check that the reply says private: true, then confirm with qurl status <CRID> -o json that connection\_state is "serving".                                                     |
| Check it yourself    | qurl get <CRID> opens the resource in your browser through a link of its own, so the one you send stays unused. Your browser lists one file, secret.txt.                                                                                                                                                    |
| Make one link        | qurl share <CRID> --ttl 1h --session-duration 5m. The link opens once, an unopened link expires within the hour, and the opened browser keeps access for five minutes. The expiry line under the link must say “single use”; if it does not, do not send it.                                                |
| Send it              | Send it in a direct message, not a public channel: whoever opens it first uses it. Avoid email and apps that preview links, because a scanner that runs the page could use its one opening. Don’t open it yourself to check it, for the same reason. Ask them to tell you once they have copied the secret. |
| Delete everything    | As in the last step above: qurl delete <CRID> --yes, stop the server and remove the folder.                                                                                                                                                                                                                 |

## Example: hand over a 1Password share link

A 1Password share link is a secret in its own right: whoever has it can open the item until it expires, and the recipient needs no 1Password account. Sending it through qURL keeps it out of chat and email history.

__Example: hand over a 1Password share link__
| Step                | What to do                                                                                                                                                                                     |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| In 1Password        | Share the item, choose when the link expires, and choose who can open it: anyone with the link, or only the email addresses you enter. Entering the recipient’s email adds a check of its own. |
| Copy the share link | The 1Password link is the secret: copy it, and pbpaste > secret.txt in step 2 saves it. Follow the rest of the walkthrough as written, with an invitation or a single-use link.                |
| When they have it   | Delete the qURL resource as in the last step, then select Delete link in the item’s sharing history in 1Password.                                                                              |

Sources: [1Password: Share items with anyone](https://support.1password.com/share-items/).

## Troubleshooting

__Troubleshooting__
| If you see                                                                                | Do this                                                                                                                                                                                                                                                                                                                              |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| The invitation email has not arrived                                                      | Ask them to check spam for the address you invited. Run qurl access list\_invitations <CRID> -o json to confirm the address and that delivery was accepted. If the address was wrong, invite the right one; the wrong one can still enrol, so remove it with qurl access revoke\_invitation, or delete the resource and start again. |
| With a single-use link, the person sees “Access link invalid” the first time they open it | The link was opened before them, perhaps by a link preview or a scanner, or it expired. Treat the secret as exposed: delete the resource, change the secret, and send the new one in a direct message.                                                                                                                               |

__More troubleshooting__
| If you see                                                    | Do this                                                                                                                                               |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| The person sees “Resource not found”                          | The resource was deleted before they opened it. Publish the folder again and invite them again, or send a new link.                                   |
| The person sees a list of more files than secret.txt          | The server was started in another folder. Stop it, delete the resource, and start again from step 2 in a new, empty folder.                           |
| qurl publish cannot connect to the server on 127.0.0.1        | Start the server from step 3 first and keep it running, then check it with curl on the same address and port.                                         |
| qurl status does not report connection\_state "serving"       | Run qurl inspect <CRID> -o json for the reason. Check that the server still answers on 127.0.0.1 with curl, then run qurl start <CRID>.               |
| publish says “Quota Exceeded” or that a plan limit is reached | Run qurl list --status active, then qurl delete <CRID> for any resource you no longer need. qurl stop keeps the resource, so it does not free a slot. |

## Frequently Asked Questions

How do I share an API key securely with a teammate? 

Save it in a file of its own, serve the folder on 127.0.0.1, publish it invite-only with qurl publish, and invite your teammate’s email with qurl access invite. Delete the resource and the file once they have it, and rotate the key if anything looked wrong.

Why invite by email instead of sending a link? 

An invitation opens only for the person who verifies that email address and saves a passkey, so a forwarded email or a link preview gets nobody else in. A single-use link is quicker and needs nothing from them, but whoever opens it first gets the secret. Use the link when you don’t have their email.

Can I send a 1Password share link this way? 

Yes. The 1Password share link is the secret you save in the file. Set its expiry in 1Password, and enter the recipient’s email there if you know it, then delete the link in 1Password once they have opened the item.

Can a coding agent do this without seeing the secret? 

Yes, if you save the file yourself. The agent prompt above tells the agent not to read or print secret.txt: it only serves the folder, publishes it, sends the invitation and cleans up.

What if someone else opens a single-use link first? 

They get the secret, and your recipient sees “Access link invalid”. A single-use link admits whoever opens it first, so treat the secret as exposed: change it, and send the new one in a direct message.

Who else can open the secret while a single-use link is live? 

The link admits whoever opens it first. Opening it in a browser starts a session for that browser, and another browser on the same public IP cannot use its access. A script or agent that opens the link without a browser is admitted by its network address instead, which other devices on that public IP share until the session ends.

Can the person open the secret again later? 

With an invitation, yes: they come back with the same passkey until you delete the resource. With a single-use link, their browser keeps access for up to five minutes after the first open, the session length set with --session-duration; opening the same link again shows “Access link invalid”.

## Related Resources

[Guide: Make a one-time link for a demo →](https://layerv.ai/guides/one-time-link-for-a-demo/) [Guide: Revoke access to a shared app →](https://layerv.ai/guides/revoke-access-to-a-shared-app/) [Guide: Give an external reviewer temporary access to localhost →](https://layerv.ai/guides/share-localhost-with-temporary-access-link/) [Glossary: Single-use link →](https://layerv.ai/glossary/single-use-link/) [The qURL skill →](https://layerv.ai/skills/qurl/SKILL.md)

## Invite the one person

After the folder is served and published invite-only, invite the person who should get the secret.

[Or use the CLI →](https://layerv.ai/cli/)



---

*This markdown version is auto-generated from [https://layerv.ai/guides/share-an-api-key-securely/](https://layerv.ai/guides/share-an-api-key-securely/) for AI agents. Curated agent resources: [llms.txt](https://layerv.ai/llms.txt). For the full interactive experience, visit the HTML version.*

